/*-------------------------------------------------------------------------------------------------------------------------------------------
Program: Appendix_v2.do
Task: Create all charts and figures in the Appendix
project: Effect of Incentives on Motivated Numeracy amidst Covid-19
Mnemonic name: pol
Date created: 05/06/2022
Comments: This program creates all charts and figures shown in the Appendix
--------------------------------------------------------------------------------------------------------------------------------------------*/
*version Stata/SE 17

clear all
set more off
macro drop _all

do pol_dir_v2  // !!!! establishes directories to store output. Look in this file first

macro list
capture log close
log using "${main_appendix}/appendixreplication_v2.log", replace
use "${main_data}/pol_v0.8.dta", clear

***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Nested Quotas
* Table A1-A6 report the planned and actual sample sizes of different demographics. The code below shows the actual sample sizes in the data.
*Table A1
tab vote2016

*Table A2
tab race

*Table A3
tab edu if race==1  /*race is 1 for non-hispanic white*/

*Table A4
tab edu if race==2 /*race is 2 for non-hispanic blacks*/

*Table A5
tab edu if race==3  /*race is 3 for hispanic*/

*Table A6
tab edu if race==4 /*race is 4 for asian*/
*-------------------------------------------------------------------------------

***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Descriptive Statistics
* Table A7
*-------------------------------------------------------------------------------
*-------------------------------------------------------------------------------
* Table A7: Participant Characteristics ******
*-------------------------------------------------------------------------------
* OUTCOME
* Correct(%)
gen pct_correct = correct * 100
label var  pct_correct "Correct answer(\%)"

* TREAETMENTS AND THEORETICAL VARIABLES
* Covid-Increase treatment(%)
gen pct_covid_inc = covid_inc * 100
label var  pct_covid_inc "Covid-Increase treatment(\%)"

* Covid-Decrease treatment(%)
gen pct_covid_dec = covid_dec * 100
label var  pct_covid_dec "Covid-Decrease treatment(\%)"

* Numeracy
label var  num "No. of correct answer (out of 6)"

* Numeracy standardized
label var  numeracy "Numeracy (standardized: -2.70 to 3.30, centered at 0)"


* Incentive(%)
gen pct_incentive = incentive * 100
label var  pct_incentive "Incentive(\%)"

* Conservative
label var nonstd_conservative "Conservative (-3 to 3)"

* Conservative standardzied
label var conservative "Conservative (standardized: -1.73 to 1.88, centered at 0)"

* Congenial
label var	congenial "Congenial"

* CONTROLS
* Age
label var  age "Age"

* Gender - Female(%)
gen pct_female = female * 100
label var  pct_female "Female(\%)"

* Ethnicity - Non-Hispanic White(%)
gen race_nhw = 0
replace race_nhw = 1 if race == 1
label variable race_nhw "=1 if race is Non-Hispanic White"
gen pct_race_nhw = race_nhw * 100
label var  pct_race_nhw "Non-hispanic white(\%)"

* Ethnicity - Hispanic(%)
gen race_hispanic = 0
replace race_hispanic = 1 if race == 3
label variable race_hispanic "=1 if race is Hispanic"
gen pct_race_hispanic = race_hispanic * 100
label var  pct_race_hispanic "Hispanic(\%)"

* Ethnicity - Others(%)
gen race_other = 0
replace race_other = 1 if race != 1 & race != 3
label variable race_other "=1 if race is Other"
gen pct_race_other = race_other * 100
label var  pct_race_other "Other races(\%)"

* Education - High school or less(%)
gen edu_highschool = 0
replace edu_highschool = 1 if edu == 1 | edu == 2
label variable edu_highschool "=1 if edu is high school or less"
gen pct_edu_highschool = edu_highschool * 100
label var  pct_edu_highschool "High school or less(\%)"

* Education - College grad/Some college(%)
gen edu_college = 0
replace edu_college = 1 if edu == 3 | edu == 4
label variable edu_college "=1 if edu is college grad or some college"
gen pct_edu_college = edu_college * 100
label var  pct_edu_college "College grad/Some college(\%)"

* Education - Post grad/others(%)
gen edu_other = 0
replace edu_other = 1 if edu == 5 | edu == 6
label variable edu_other "=1 if edu is post grad or others"
gen pct_edu_other = edu_other * 100
label var  pct_edu_other "Post grad/Others(\%)"

* Vote2016 - Donald Trump(%)
gen vote2016_trump = 0
replace vote2016_trump = 1 if vote2016 == 1
label variable vote2016_trump "=1 if vote2016 is Trump"
gen pct_vote2016_trump = vote2016_trump * 100
label var  pct_vote2016_trump "Vote Donald Trump(\%)"

* Vote2016 - Hillary Clinton(%)
gen vote2016_clinton = 0
replace vote2016_clinton = 1 if vote2016 == 2
label variable vote2016_clinton "=1 if vote2016 is Clinton"
gen pct_vote2016_clinton = vote2016_clinton * 100
label var  pct_vote2016_clinton "Vote Hillary Clinton(\%)"

* Vote2016 - No vote(%)
gen vote2016_novote = 0
replace vote2016_novote = 1 if vote2016 == 4
label variable vote2016_novote "=1 if vote2016 is No vote"
gen pct_vote2016_novote = vote2016_novote * 100
label var  pct_vote2016_novote "No Vote(\%)"


estpost	sum		pct_correct 													///
				pct_covid_inc pct_covid_dec num numeracy pct_incentive 					///
				nonstd_conservative conservative congenial 									///
				age pct_female pct_race_nhw pct_race_hispanic pct_race_other	///
				pct_edu_highschool pct_edu_college pct_edu_other				///
				pct_vote2016_trump pct_vote2016_clinton pct_vote2016_novote		

esttab using "${main_appendix}/Table_A7.tex", ///
				cells((mean (fmt(2)) sd (fmt(2))))  label replace ///
				nofloat
eststo 	clear 
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Balance table
* Table A8
*-------------------------------------------------------------------------------
*-------------------------------------------------------------------------------
* Table A8: Balance on observable covariates among treatment groups
*-------------------------------------------------------------------------------
* Generate new variables for balance table
* Treatment
* Treatment 1 = No incentive/Covid-decrease
* Treatment 2 = No incentive/Covid-increase
* Treatment 3 = Incentive/Covid-decrease
* Treatment 4 = Incentive/Covid-increase
gen treatment1 = 0 
gen treatment2 = 0 
gen treatment3 = 0 
gen treatment4 = 0
replace treatment1 = 1 if treatment == 1
replace treatment2 = 1 if treatment == 2
replace treatment3 = 1 if treatment == 3
replace treatment4 = 1 if treatment == 4

* Calculate values in the Balance table
foreach yvar in age female 										///
				race_nhw race_hispanic race_other 				///
				edu_highschool edu_college edu_other 			///
				vote2016_trump vote2016_clinton vote2016_novote{

reg 		`yvar' treatment2 treatment3 treatment4, robust
reg 		`yvar' treatment1 treatment3 treatment4, robust
reg 		`yvar' treatment1 treatment2 treatment4, robust
predict 	`yvar'_hat
predict 	`yvar'_se, stdp
}
***********************************************************************************************************************************************
			*******The collapsed data is manually formatted to create Table A8********************
***********************************************************************************************************************************************

collapse	(mean)  mean_age = age  							(semean) se_age = age								///
			(mean)  mean_female = female  						(semean) se_female = female							///
			(mean)  mean_race_nhw = race_nhw  					(semean) se_race_nhw = race_nhw						///
			(mean)  mean_race_hispanic  = race_hispanic   		(semean) se_race_hispanic = race_hispanic			///
			(mean)  mean_race_other = race_other  				(semean) se_race_other = race_other					///
			(mean)  mean_edu_highschool = edu_highschool  		(semean) se_edu_highschool = edu_highschool			///
			(mean)  mean_edu_college = edu_college  			(semean) se_edu_college = edu_college				///
			(mean)  mean_edu_other = edu_other  				(semean) se_edu_other = edu_other					///
			(mean)  mean_vote2016_trump = vote2016_trump  		(semean) se_vote2016_trump = vote2016_trump			///
			(mean)  mean_vote2016_clinton = vote2016_clinton  	(semean) se_vote2016_clinton = vote2016_clinton		///
			(mean)  mean_vote2016_novote = vote2016_novote  	(semean) se_vote2016_novote = vote2016_novote		///
			,by (treatment)

list
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Reload data
use "${main_data}/pol_v0.8.dta", clear
*-------------------------------------------------------------------------------
*-------------------------------------------------------------------------------
* Difference-in-means
* Table A9-A12
*-------------------------------------------------------------------------------
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------

/*Table A9: Differences in accuracy by levels of congeniality 
(unincentivized participants) */

su congenial, detail

gen uncongenial25 = 0
replace uncongenial25 = 1 if congenial<-.680554
tab uncongenial25

gen congenial50 = 0
replace congenial50 = 1 if congenial>-.0772435
tab congenial50


gen congenial75 = 0
replace congenial75 = 1 if congenial>.680554
tab congenial75

mat T = J(1,5,.)

ttest correct if incentive==0, by(uncongenial25)
mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)


mat rownames T =  "Accuracy rate"  

	frmttable using cp_ttest_table3a.doc, statmat(T) varlabels replace ///
	ctitle("",  Congeniality more than 25th pct=0, Congeniality less than 25th pct=1, Difference, t-statistic, p-value)

ttest correct if incentive==0, by(congenial50)

mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)

mat rownames T =  "Accuracy rate"  

	frmttable using cp_ttest_table3a.doc, statmat(T) varlabels replace ///
	ctitle("",  Congeniality less than 50th pct=0, Congeniality more than 50th pct=1, Difference, t-statistic, p-value)

ttest correct if incentive==0, by(congenial75)
mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)

mat rownames T =  "Accuracy rate"  

	frmttable using cp_ttest_table3a.doc, statmat(T) varlabels replace ///
	ctitle("",  Congeniality less than 75th pct=0, Congeniality more than 75th pct=1, Difference, t-statistic, p-value)

*-------------------------------------------------------------------------------
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------

/*Table A10: Differences in accuracy by levels of congeniality and numeracy 
(unincentivized participants)
*/
	
su numeracy, detail
** 0.5 SD = 1.653891/2=0.8269455
gen less_num = 0
replace less_num = 1 if numeracy< -0.8269455
tab less_num

gen more_num = 0
replace more_num = 1 if numeracy> 0.8269455
tab more_num

*** Strongly uncongenial data ***
mat T = J(2,5,.)
	 
ttest correct if incentive==0 & less_num==1, by(uncongenial25)
mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)

ttest correct if incentive==0 & more_num==1, by(uncongenial25)
mat T[2,1] = r(mu_1)
mat T[2,2] = r(mu_2)
mat T[2,3] = r(mu_1) - r(mu_2)
mat T[2,4] = r(t)
mat T[2,5] = r(p)

mat rownames T =  "Accuracy rate for less numerate"  "Accuracy rate for more numerate"

	frmttable using cp_ttest_table3a.doc, statmat(T) varlabels replace ///
	ctitle("",  Congeniality MORE than 25th pct=0, Congeniality LESS than 25th pct=1, Difference, t-statistic, p-value)

	
*** Rather congenial data ***
mat T = J(2,5,.)
	 
ttest correct if incentive==0 & less_num==1, by(congenial50)
mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)

ttest correct if incentive==0 & more_num==1, by(congenial50)
mat T[2,1] = r(mu_1)
mat T[2,2] = r(mu_2)
mat T[2,3] = r(mu_1) - r(mu_2)
mat T[2,4] = r(t)
mat T[2,5] = r(p)

mat rownames T =  "Accuracy rate for less numerate"  "Accuracy rate for more numerate"

	frmttable using cp_ttest_table3a.doc, statmat(T) varlabels replace ///
	ctitle("",  Congeniality less than 50th pct=0, Congeniality more than 50th pct=1, Difference, t-statistic, p-value)


	
*** Strongly congenial data ***
mat T = J(2,5,.)
	 
ttest correct if incentive==0 & less_num==1, by(congenial75)
mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)

ttest correct if incentive==0 & more_num==1, by(congenial75)
mat T[2,1] = r(mu_1)
mat T[2,2] = r(mu_2)
mat T[2,3] = r(mu_1) - r(mu_2)
mat T[2,4] = r(t)
mat T[2,5] = r(p)

mat rownames T =  "Accuracy rate for less numerate"  "Accuracy rate for more numerate"

	frmttable using cp_ttest_table3a.doc, statmat(T) varlabels replace ///
	ctitle("",  Congeniality less than 75th pct=0, Congeniality more than 75th pct=1, Difference, t-statistic, p-value)
	
*-------------------------------------------------------------------------------
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
	
/*Table A11: Differences in accuracy by incentive*/	

mat T = J(1,5,.)

ttest correct,by(incentive)

mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)


mat rownames T =  "Accuracy rate"  

	frmttable using cp_ttest_table3a.doc, statmat(T) varlabels replace ///
	ctitle("",  Incentive=0, Incentive=1, Difference, t-statistic, p-value)

	
*-------------------------------------------------------------------------------
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------

/*Table A12: Differences in accuracy by levels of congeniality and numeracy 
(incentivized participants)*/	


*** Strongly uncongenial data ***
mat T = J(2,5,.)
	 
ttest correct if incentive==1 & less_num==1, by(uncongenial25)
mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)

ttest correct if incentive==1 & more_num==1, by(uncongenial25)
mat T[2,1] = r(mu_1)
mat T[2,2] = r(mu_2)
mat T[2,3] = r(mu_1) - r(mu_2)
mat T[2,4] = r(t)
mat T[2,5] = r(p)

mat rownames T =  "Accuracy rate for less numerate"  "Accuracy rate for more numerate"

	frmttable using cp_ttest_table3a.doc, statmat(T) varlabels replace ///
	ctitle("",  Congeniality MORE than 25th pct=0, Congeniality LESS than 25th pct=1, Difference, t-statistic, p-value)

	
*** Rather congenial data ***
mat T = J(2,5,.)
	 
ttest correct if incentive==1 & less_num==1, by(congenial50)
mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)

ttest correct if incentive==1 & more_num==1, by(congenial50)
mat T[2,1] = r(mu_1)
mat T[2,2] = r(mu_2)
mat T[2,3] = r(mu_1) - r(mu_2)
mat T[2,4] = r(t)
mat T[2,5] = r(p)

mat rownames T =  "Accuracy rate for less numerate"  "Accuracy rate for more numerate"

	frmttable using cp_ttest_table3a.doc, statmat(T) varlabels replace ///
	ctitle("",  Congeniality less than 50th pct=0, Congeniality more than 50th pct=1, Difference, t-statistic, p-value)


	
*** Strongly congenial data ***
mat T = J(2,5,.)
	 
ttest correct if incentive==1 & less_num==1, by(congenial75)
mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)

ttest correct if incentive==1 & more_num==1, by(congenial75)
mat T[2,1] = r(mu_1)
mat T[2,2] = r(mu_2)
mat T[2,3] = r(mu_1) - r(mu_2)
mat T[2,4] = r(t)
mat T[2,5] = r(p)

mat rownames T =  "Accuracy rate for less numerate"  "Accuracy rate for more numerate"

	frmttable using cp_ttest_table3a.doc, statmat(T) varlabels replace ///
	ctitle("",  Congeniality less than 75th pct=0, Congeniality more than 75th pct=1, Difference, t-statistic, p-value)
	
drop uncongenial25 congenial50 congenial75 more_num less_num 

*-------------------------------------------------------------------------------

***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Inferiority tests
* Logistic regression - Logit model is used in these two tables
* Table A13&A14: The impact of incentives, numeracy and congeniality on accuracy
* Table A13 for unincentivized paticipants
* Table A14 for all participants
*-------------------------------------------------------------------------------
*-------------------------------------------------------------------------------
* Table A13: The impact of numeracy and congeniality on accuracy (unincentivized)
*-------------------------------------------------------------------------------
* Adjust the label values to accomodate the table
label var correct "Correct"
label var incentive "Incentive"
label var congenial "Congenial"
label var numeracy "Numeracy"
label var numsq "Numeracy$^2$"
label var num_con "Numeracy $\times$ Congenial"
label var in_num_con "Incentive $\times$ Numeracy $\times$ Congenial"
label var in_con "Incentive $\times$ Congenial"
label var in_num "Incentive $\times$ Numeracy"
label var in_numsq "Incentive $\times$ Numeracy$^2$"
label var in_numsq_con "Incentive $\times$ Numeracy$^2$ $\times$ Congenial"

* Equation 1 (without control variables) - Table A13 (1)
logit correct congenial numeracy numsq if incentive==0, r
estadd local Controls "No"
est store a1

* Equation 1 (with control variables) - Table A13 (2)
logit correct  congenial numeracy numsq age i.gender i.race i.edu i.vote2016 if incentive==0, r
estadd local Controls "Yes"
est store a2

* Equation 2 (without control variables) - Table A13 (3)
logit correct congenial numeracy numsq num_con c.numsq#c.congenial  if incentive==0, r
estadd local Controls "No"
est store a3

* Equation 2 (with control variables) - Table A13 (4)
logit correct congenial numeracy numsq num_con c.numsq#c.congenial age i.gender i.race i.edu i.vote2016 if incentive==0, r
estadd local Controls "Yes"
est store a4

* Export Table A13 in Latex
esttab  a1 a2 a3 a4 using "${main_appendix}/Table_A13.tex",  ///
		eqlabel(none) nonumbers mtitles("(1)" "(2)" "(3)" "(4)") b(3) star(* 0.10 ** 0.05  *** 0.01) se(3) label  ///
		replace 	///
		drop(age *gender* *race* *edu* *vote2016*) /// 
		scalars("Controls") ///
		tex addnotes("Note:Logit regression with heterscedasticity robust standard errors." "Control variables in the regression are age, gender, race, education, and voting2016")
eststo clear
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Table A14: The impact of incentives, numeracy, and congeniality on accuracy (all)
*-------------------------------------------------------------------------------
* Equation 3 (without control variables) - Table A14 (5)
logit correct incentive, r
estadd local Controls "No"
est store a5

* Equation 3 (with control variables) - Table A14 (6)
logit correct incentive age i.gender i.race i.edu i.vote2016, r
estadd local Controls "Yes"
est store a6

* Equation 4 (excl. 2 variables) (without control variables) - Table A14 (7)
logit correct numeracy congenial num_con numsq c.numsq#c.congenial incentive in_con in_num in_num_con, r
estadd local Controls "No"
est store a7

* Equation 4 (excl. 2 variables) (with control variables) - Table A14 (8)
logit correct  congenial numeracy num_con numsq c.numsq#c.congenial incentive in_con in_num in_num_con age i.gender i.race i.edu i.vote2016, r
estadd local Controls "Yes"
est store a8

* Equation 4 (without control variables) - Table A14 (9)
logit correct  congenial numeracy num_con numsq c.numsq#c.congenial incentive in_con in_num in_numsq in_num_con in_numsq_con, r
estadd local Controls "No"
est store a9

* Equation 4 (with control variables) - Table A14 (10)
logit correct  congenial numeracy num_con numsq c.numsq#c.congenial incentive in_con in_num in_numsq in_num_con in_numsq_con age i.gender i.race i.edu i.vote2016, r
estadd local Controls "Yes"
est store a10

* Export Table A14 in Latex
esttab  a5 a6 a7 a8 a9 a10 using "${main_appendix}/Table_A14.tex",  ///
		eqlabel(none) nonumbers mtitles("(5)" "(6)" "(7)" "(8)" "(9)" "(10)") b(3) star(* 0.10 ** 0.05  *** 0.01) se(3) label  ///
		replace 	///
		drop(age *gender* *race* *edu* *vote2016*) /// 
		scalars("Controls") ///
		tex addnotes("Note:Logit regression with heterscedasticity robust standard errors." "Control variables in the regression are age, gender, race, education, and voting2016")					
eststo clear
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Order effects
* Table A15: Dependent variable is Numeracy
* Table A16: Dependent variable is Correct
* Table A17: Testing for hypotheses 1 and 2 controlling for order effects
* Table A18: Testing for hypothesis 3 and 4 controlling for order effects
*-------------------------------------------------------------------------------
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Table A15: Dependent variable is Numeracy
*-------------------------------------------------------------------------------
reg num order_num_treat, r
est store a1
 
reg num order_num_treat if incentive == 0, r
est store a2
 
reg num order_num_treat if incentive ==1, r
est store a3

* Export Table A15 in Latex
esttab a1 a2 a3 using "${main_appendix}/Table_A15.tex",  			///
		nonumbers  b(3) star(* 0.10 ** 0.05  *** 0.01) se(3) label  ///
		title(Randomized order effect: Num) replace 				///
		mtitle("Total" "Non-incentivized" "Incentivized")
eststo clear
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Table A16: Dependent variable is Correct
*-------------------------------------------------------------------------------
reg correct order_num_treat, r
est store a4
 
reg correct order_num_treat if incentive ==1, r
est store a5
 
reg correct order_num_treat if incentive == 0, r
est store a6

* Export Table A16 in Latex 
esttab a4 a6 a5 using "${main_appendix}/Table_A16.tex",  			///
		nonumbers  b(3) star(* 0.10 ** 0.05  *** 0.01) se(3) label  ///
		title(Randomized order effect: Correct) replace 			///
		mtitle("Total" "Non-incentivized" "Incentivized")
eststo clear
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------		
* Table A17: Testing for hypotheses 1 and 2 controlling for order effects
*-------------------------------------------------------------------------------
* Adjust the label values to accomodate the table
label var correct "Correct"
label var incentive "Incentive"
label var congenial "Congenial"
label var numeracy "Numeracy"
label var numsq "Numeracy$^2$"
label var num_con "Numeracy $\times$ Congenial"
label var in_num_con "Incentive $\times$ Numeracy $\times$ Congenial"
label var in_con "Incentive $\times$ Congenial"
label var in_num "Incentive $\times$ Numeracy"
label var in_numsq "Incentive $\times$ Numeracy$^2$"
label var in_numsq_con "Incentive $\times$ Numeracy$^2$ $\times$ Congenial"

* Equation 1 (without control variables) - Table A17 (1)
reg correct order_num_treat congenial numeracy numsq if incentive==0, r
estadd local Controls "No"
est store a1

* Equation 1 (with control variables) - Table A17 (2)
reg correct order_num_treat congenial numeracy numsq age i.gender i.race i.edu i.vote2016 if incentive==0, r
estadd local Controls "Yes"
est store a2

* Equation 2 (without control variables) - Table A17 (3)
reg correct order_num_treat congenial numeracy numsq num_con c.numsq#c.congenial  if incentive==0, r
estadd local Controls "No"
est store a3

* Equation 2 (with control variables) - Table A17 (4)
reg correct order_num_treat congenial numeracy numsq num_con c.numsq#c.congenial age i.gender i.race i.edu i.vote2016 if incentive==0, r
estadd local Controls "Yes"
est store a4

* Export Table A17 in Latex 
esttab  a1 a2 a3 a4 using "${main_appendix}/Table_A17.tex",  ///
		nonumbers mtitles("(1)" "(2)" "(3)" "(4)") b(3) star(* 0.10 ** 0.05  *** 0.01) se(3) ar2  label  ///
		replace 	///
		drop(age *gender* *race* *edu* *vote2016*) /// 
		scalars("Controls") ///
		tex addnotes("Note:Linear Probability Model with heterscedasticity robust standard errors." "Control variables in the regression are age, gender, race, education, and voting2016")
eststo clear
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------		
* Table A18: Testing for hypothesis 3 and 4 controlling for order effects
*-------------------------------------------------------------------------------
* Equation 3 (without control variables) - Table A18 (5)
reg correct order_num_treat incentive, r
estadd local Controls "No"
est store a5

* Equation 3 (with control variables) - Table A18 (6)
reg correct order_num_treat incentive age i.gender i.race i.edu i.vote2016, r
estadd local Controls "Yes"
est store a6

* Equation 4 (excl. 2 variables) (without control variables) - Table A18 (7)
reg correct order_num_treat numeracy congenial num_con numsq c.numsq#c.congenial incentive in_con in_num in_num_con, r
estadd local Controls "No"
est store a7

* Equation 4 (excl. 2 variables) (with control variables) - Table A18 (8)
reg correct order_num_treat congenial numeracy num_con numsq c.numsq#c.congenial incentive in_con in_num in_num_con age i.gender i.race i.edu i.vote2016, r
estadd local Controls "Yes"
est store a8

* Equation 4 (without control variables) - Table A18 (9)
reg correct order_num_treat congenial numeracy num_con numsq c.numsq#c.congenial incentive in_con in_num in_numsq in_num_con in_numsq_con, r
estadd local Controls "No"
est store a9

* Equation 4 (without control variables) - Table A18 (10)
reg correct order_num_treat congenial numeracy num_con numsq c.numsq#c.congenial incentive in_con in_num in_numsq in_num_con in_numsq_con age i.gender i.race i.edu i.vote2016, r
estadd local Controls "Yes"
est store a10

* Export Table A18 in Latex 

esttab  a5 a6 a7 a8 a9 a10 using "${main_appendix}/Table_A18.tex" ,  ///
		nonumbers mtitles("(5)" "(6)" "(7)" "(8)" "(9)" "(10)") b(3) star(* 0.10 ** 0.05  *** 0.01) se(3) ar2 label  ///
		replace 	///
		drop(age *gender* *race* *edu* *vote2016*) /// 
		scalars("Controls") ///
		tex addnotes("Note:Linear Probability Model with heterscedasticity robust standard errors." "Control variables in the regression are age, gender, race, education, and voting2016")
eststo clear
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Split sample analyses - Numeracy *AFTER* treatment
* Table A19: The impact of numeracy and congeniality on accuracy
* Table A20: The impact of incentive, numeracy, and congeniality on accuracy
* Figure A1: Predicted probabilities of correctly interpreting the data (-1,0,1SD)
* Figure A2: Predicted probabilities of correctly interpreting the data (2SD)
* Table A21: Differences in the predicted congeneity bias
*-------------------------------------------------------------------------------
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Table A19: The impact of numeracy and congeniality on accuracy
*-------------------------------------------------------------------------------
* Numeracy is measured after (order_num_treat == 0)
* Equation 1 (without control variables) - Table A19 (1)
reg correct congenial numeracy numsq if incentive==0 & order_num_treat==0, r
estadd local Controls "No"
est store a1

* Equation 1 (with control variables) - Table A19 (2)
reg correct congenial numeracy numsq age i.gender i.race i.edu i.vote2016 if incentive==0 & order_num_treat==0, r
estadd local Controls "Yes"
est store a2

* Equation 2 (without control variables) - Table A19 (3)
reg correct congenial numeracy numsq num_con c.numsq#c.congenial  if incentive==0 & order_num_treat==0, r
estadd local Controls "No"
est store a3

* Equation 2 (without control variables) - Table A19 (4)
reg correct congenial numeracy numsq num_con c.numsq#c.congenial age i.gender i.race i.edu i.vote2016 if incentive==0 & order_num_treat==0, r
estadd local Controls "Yes"
est store a4

* Export Table A19 in Latex 
esttab  a1 a2 a3 a4 using "${main_appendix}/Table_A19.tex" ,  ///
		nonumbers mtitles("(1)" "(2)" "(3)" "(4)") b(3) star(* 0.10 ** 0.05  *** 0.01) se(3) ar2  label  ///
		replace 	///
		drop(age *gender* *race* *edu* *vote2016*) /// 
		scalars("Controls") ///
		tex addnotes("Note:Linear Probability Model with heterscedasticity robust standard errors." "Control variables in the regression are age, gender, race, education, and voting2016")
eststo clear
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Table A20: The impatc of incentive, numeracy, and congeniality on accuracy
*-------------------------------------------------------------------------------
* Numeracy is measured after (order_num_treat == 0)
* Equation 3 (without control variables) - Table A20 (5)
reg correct incentive if order_num_treat==0, r
estadd local Controls "No"
est store a5

* Equation 3 (with control variables) - Table A20 (6)
reg correct incentive age i.gender i.race i.edu i.vote2016 if order_num_treat==0, r
estadd local Controls "Yes"
est store a6

* Equation 4 (excl. 2 variables) (without control variables) - Table A20 (7)
reg correct numeracy congenial num_con numsq c.numsq#c.congenial incentive in_con in_num in_num_con if order_num_treat==0, r
estadd local Controls "No"
est store a7

* Equation 4 (excl. 2 variables) (with control variables) - Table A20 (8)
reg correct  congenial numeracy num_con numsq c.numsq#c.congenial incentive in_con in_num in_num_con age i.gender i.race i.edu i.vote2016 if order_num_treat==0, r
estadd local Controls "Yes"
est store a8

* Equation 4 (without control variables) - Table A20 (9)
reg correct  congenial numeracy num_con numsq c.numsq#c.congenial incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat==0, r
estadd local Controls "No"
est store a9

* Equation 4 (with control variables) - Table A20 (10)
reg correct  congenial numeracy num_con numsq c.numsq#c.congenial incentive in_con in_num in_numsq in_num_con in_numsq_con age i.gender i.race i.edu i.vote2016 if order_num_treat==0, r
estadd local Controls "Yes"
est store a10

* Export Table A20 in Latex 
esttab  a5 a6 a7 a8 a9 a10 using "${main_appendix}/Table_A20.tex" ,  ///
		nonumbers mtitles("(5)" "(6)" "(7)" "(8)" "(9)" "(10)") b(3) star(* 0.10 ** 0.05  *** 0.01) se(3) ar2 label  ///
		replace 	///
		drop(age *gender* *race* *edu* *vote2016*) /// 
		scalars("Controls") ///
		tex addnotes("Note:Linear Probability Model with heterscedasticity robust standard errors." "Control variables in the regression are age, gender, race, education, and voting2016")					
eststo clear
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Figure A1: Predicted probabilities of correctly interpreting the data (-1,0,1SD)
* The program "Clarify" is necessary to run these simulations.
* Please see "Clarify: Software for Interpreting and Presenting Statistical Results" (Tomz, Wittenberg, and King; 2001) for your reference.
*-------------------------------------------------------------------------------
* GRAPH1: TOP-LEFT Graph (Non-incentivized & Low numeracy)
* Graph below is the no-incentives low numeracy graph that will be in the top-left of the four graphs
* Low Numeracy, Incentive=0
* For the three simulations below: num=1 out 6 questions correctly solved, numeracy=-1.666, incentive =0

* Congenial = -1
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy -1.666 congenial -1 num_con 1.666 numsq 2.776 numsq_con -2.776 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 0
simqi, prval(1) genpr(p1)
drop b*

* Congenial = +1
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy -1.666 congenial 1 num_con -1.666 numsq 2.776 numsq_con 2.776 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 0
simqi, prval(1) genpr(p2)
drop b*

* Congenial = 0
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy -1.666 congenial 0 num_con 0 numsq 2.776 numsq_con 0 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 0
simqi, prval(1) genpr(p3)
drop b*

sum p1 p2 p3

*-------------------------------------------------------GRAPH1-----------------------------------------------------------------
graph twoway 	(kdensity p1, lcolor(orange) lwidth(medthick) text(10 0.33 "Congenial = -1", color (orange) size(small)))	///
				(kdensity p2, lcolor(green) lwidth(medthick) text(9.5 0.54 "Congenial = +1", color (green) size(small)))	/// 
				(kdensity p3, lcolor(gs5) lwidth(medthick) text(12 0.48 "Congenial = 0", color (gs5) size(small)))			///
				,legend(off)																								///
				ylabel("")																									///
				ytitle("Non-Incentivized", orientation(vertical) size(medium)) 												///
				xlabel(0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%") 													///
				xtitle("") 																									///
				title("Low numeracy", size (medium))																		///
				name(topleft1, replace) scheme(plotplain)
graph close
drop p1 p2 p3
*------------------------------------------------------------------------------------------------------------------------------
* GRAPH2: TOP-RIGHT Graph (Non-incentivized & High numeracy)
* Graph below is the no-incentives high numeracy graph that will be in the top-right of the four graphs
* High Numeracy, Incentive=0
* For the three simulations below: num=4.35 out 6 questions correctly solved, numeracy=+1.666, incentive =0

* Congenial = -1
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy 1.666 congenial -1 num_con -1.666 numsq 2.776 numsq_con -2.776 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 0
simqi, prval(1) genpr(p1)
drop b*

* Congenial = +1
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy 1.666 congenial 1 num_con 1.666 numsq 2.776 numsq_con 2.776 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 0
simqi, prval(1) genpr(p2)
drop b*

* Congenial = 0
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy 1.666 congenial 0 num_con 0 numsq 2.776 numsq_con 0 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 0
simqi, prval(1) genpr(p3)
drop b*

sum p1 p2 p3

*-------------------------------------------------------GRAPH2-----------------------------------------------------------------
graph twoway 	(kdensity p1, lcolor(orange) lwidth(medthick) text(12 0.26 "Congenial = -1", color (orange) size(small))) 	///
				(kdensity p2, lcolor(green) lwidth(medthick) text(10 0.45 "Congenial = +1", color (green) size(small)))		/// 
				(kdensity p3, lcolor(gs5) lwidth(medthick) text(12.5 0.41 "Congenial = 0", color (gs5) size(small)))		///
				,legend(off)																								///
				ylabel("")																									///
				ytitle("") 																									///
				xlabel(0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%") 													///
				xtitle("") 																									///
				title("High numeracy", size (medium))																		///
				name(topright1, replace) scheme(plotplain)
graph close
drop p1 p2 p3
*------------------------------------------------------------------------------------------------------------------------------
* GRAPH3: BOTTOM-LEFT Graph (Incentivized & Low numeracy)
* Graph below is the incentives low numeracy graph that will be in the bottom-left of the four graphs
* Low Numeracy, Incentive=1
* For the three simulations below: num=1 out 6 questions correctly solved, numeracy=-1.666, incentive =1

* Congenial = -1
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy -1.666 congenial -1 num_con 1.666 numsq 2.776 numsq_con -2.776 incentive 1 in_con -1 in_num -1.666 in_numsq 2.776 in_num_con 1.666 in_numsq_con -2.776 if order_num_treat == 0
simqi, prval(1) genpr(p1)
drop b*

* Congenial = +1
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy -1.666 congenial 1 num_con -1.666 numsq 2.776 numsq_con 2.776 incentive 1 in_con 1 in_num -1.666 in_numsq 2.776 in_num_con -1.666 in_numsq_con 2.776 if order_num_treat == 0
simqi, prval(1) genpr(p2)
drop b*

* Congenial = 0
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy -1.666 congenial 0 num_con 0 numsq 2.776 numsq_con 0 incentive 1 in_con 0 in_num -1.666 in_numsq 2.776 in_num_con 0 in_numsq_con 0 if order_num_treat == 0
simqi, prval(1) genpr(p3)
drop b*

sum p1 p2 p3
*-------------------------------------------------------GRAPH3-----------------------------------------------------------------
graph twoway 	(kdensity p1, lcolor(orange) lwidth(medthick) text(12 0.29 "Congenial = -1", color (orange) size(small)))	///
				(kdensity p2, lcolor(green) lwidth(medthick) text(9 0.47 "Congenial = +1", color (green) size(small)))		/// 
				(kdensity p3, lcolor(gs5) lwidth(medthick) text(16 0.44 "Congenial = 0", color (gs5) size(small)))			///
				,legend(off)																								///
				ylabel("")																									///
				ytitle("  Incentivized  ", orientation(vertical) size(medium))												///
				xlabel(0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%")			 										///
				xtitle("Probability of correct interpretation of data") 													///
				title("")																									///
				name(botleft1, replace) scheme(plotplain)
graph close
drop p1 p2 p3
*------------------------------------------------------------------------------------------------------------------------------
* GRAPH4: BOTTOM-RIGHT Graph (Incentivized & High numeracy)
* Graph below is the incentives high numeracy graph that will be in the bottom-right of the four graphs.*/
* High Numeracy, Incentive=1*/
* For the three simulations below: num=4.35 out 6 questions correctly solved, numeracy=1.666, incentive =1*/

* Congenial = -1
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy 1.666 congenial -1 num_con -1.666 numsq 2.776 numsq_con -2.776 incentive 1 in_con -1 in_num 1.666 in_numsq 2.776 in_num_con -1.666 in_numsq_con -2.776 if order_num_treat == 0
simqi, prval(1) genpr(p1)
drop b*

* Congenial = +1
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy 1.666 congenial 1 num_con 1.666 numsq 2.776 numsq_con 2.776 incentive 1 in_con 1 in_num 1.666 in_numsq 2.776 in_num_con 1.666 in_numsq_con 2.776 if order_num_treat == 0
simqi, prval(1) genpr(p2)
drop b*

* Congenial = 0
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy 1.666 congenial 0 num_con 0 numsq 2.776 numsq_con 0 incentive 1 in_con 0 in_num 1.666 in_numsq 2.776 in_num_con 0 in_numsq_con 0 if order_num_treat == 0
simqi, prval(1) genpr(p3)
drop b*

sum p1 p2 p3
*-------------------------------------------------------GRAPH4-----------------------------------------------------------------
graph twoway 	(kdensity p1, lcolor(orange) lwidth(medthick) text(10 0.29 "Congenial = -1", color (orange) size(small)))	///
				(kdensity p2, lcolor(green) lwidth(medthick) text(14 0.48 "Congenial = +1", color (green) size(small)))		/// 
				(kdensity p3, lcolor(gs5) lwidth(medthick) text(16 0.47 "Congenial = 0", color (gs5) size(small)))			///
				,legend(off)																								///
				ylabel("")																									///
				ytitle("")																									///
				xlabel(0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%")			 										///
				xtitle("Probability of correct interpretation of data") 													///
				title("")																									///
				name(botright1, replace) scheme(plotplain)
graph close
drop p1 p2 p3
*------------------------------------------------------------------------------------------------------------------------------
*----------------------------------------------------- GRAPH COMBINE-----------------------------------------------------------
graph combine topleft1 topright1 botleft1 botright1, xcommon scheme(plotplain)
graph export "${main_appendix}/Figure_A1.png", replace
graph close
*------------------------------------------------------------------------------------------------------------------------------
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Figure A2: Predicted probabilities of correctly interpreting the data (2SD)
* The program "Clarify" is necessary to run this simulation.
* Please see "Clarify: Software for Interpreting and Presenting Statistical Results" (Tomz, Wittenberg, and King; 2001) for your reference.
*-------------------------------------------------------------------------------
* GRAPH5: TOP-LEFT Graph
* Graph below is the no-incentives low numeracy graph that will be in the top-left of the four graphs
* Low Numeracy, Incentive=0
* For the three simulations below: num=1 out 6 questions correctly solved, numeracy=-1.666, incentive =0

* Congenial = -2
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy -1.666 congenial -2 num_con 3.332 numsq 2.776 numsq_con -5.552 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 0
simqi, prval(1) genpr(p4)
drop b*

* Congenial = +2
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy -1.666 congenial 2 num_con -3.332 numsq 2.776 numsq_con 5.552 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 0
simqi, prval(1) genpr(p5)
drop b*

*-------------------------------------------------------GRAPH5-----------------------------------------------------------------
graph twoway 	(kdensity p4, lcolor(dknavy) lwidth(medthick) text(6 0.40 "Congenial = -2", color (dknavy) size(small)))		///
				(kdensity p5, lcolor(dkorange) lwidth(medthick) text(6 0.60 "Congenial = +2", color (dkorange) size(small)))	/// 
				,legend(off)																									///
				ylabel("")																										///
				ytitle("Non-Incentivized", orientation(vertical) size(medium)) 													///
				xlabel(0.1 "10%" 0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%" 0.7 "70%" 0.8 "80%")							///
				xtitle("") 																										///
				title("Low numeracy", size (medium))																			///
				name(topleft2, replace) scheme(plotplain)
graph close
drop p4 p5 
*------------------------------------------------------------------------------------------------------------------------------
* GRAPH6: TOP-RIGHT Graph
* Graph below is the no-incentives high numeracy graph that will be in the top-right of the four graphs
* High Numeracy, Incentive=0
* For the three simulations below: num=1 out 6 questions correctly solved, numeracy=+1.666, incentive =0

* Congenial = -2
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy 1.666 congenial -2 num_con -3.332 numsq 2.776 numsq_con -5.552 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 0
simqi, prval(1) genpr(p4)
drop b*

* Congenial = +2
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy 1.666 congenial 2 num_con 3.332 numsq 2.776 numsq_con 5.552 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 0
simqi, prval(1) genpr(p5)
drop b*

*-------------------------------------------------------GRAPH6-----------------------------------------------------------------
graph twoway 	(kdensity p4, lcolor(dknavy) lwidth(medthick) text(8 0.28 "Congenial = -2", color (dknavy) size(small)))		///
				(kdensity p5, lcolor(dkorange) lwidth(medthick) text(6 0.58 "Congenial = +2", color (dkorange) size(small)))	/// 
				,legend(off)																									///
				ylabel("")																										///
				ytitle("") 																										///
				xlabel(0.1 "10%" 0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%" 0.7 "70%" 0.8 "80%")							///
				xtitle("") 																										///
				title("High numeracy", size (medium))																			///
				name(topright2, replace) scheme(plotplain)
graph close
drop p4 p5 
*------------------------------------------------------------------------------------------------------------------------------
* GRAPH7: BOTTOM-LEFT Graph
* Graph below is the incentives low numeracy graph that will be in the bottom-left of the four graphs
* Low Numeracy, Incentive=1
* For the three simulations below: num=1 out 6 questions correctly solved, numeracy=-1.666, incentive =0

* Congenial = -2
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy -1.666 congenial -2 num_con 3.332 numsq 2.776 numsq_con -5.552 incentive 1 in_con -2 in_num -1.666 in_numsq 2.776 in_num_con 3.332 in_numsq_con -5.552 if order_num_treat == 0
simqi, prval(1) genpr(p4)
drop b*

* Congenial = +2
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy -1.666 congenial 2 num_con -3.332 numsq 2.776 numsq_con 5.552 incentive 1 in_con 2 in_num -1.666 in_numsq 2.776 in_num_con -3.332 in_numsq_con 5.552 if order_num_treat == 0
simqi, prval(1) genpr(p5)
drop b*

*-------------------------------------------------------GRAPH7-----------------------------------------------------------------
graph twoway 	(kdensity p4, lcolor(dknavy) lwidth(medthick) text(7 0.23 "Congenial = -2", color (dknavy) size(small)))		///
				(kdensity p5, lcolor(dkorange) lwidth(medthick) text(7 0.52 "Congenial = +2", color (dkorange) size(small)))	/// 
				,legend(off)																									///
				ylabel("")																										///
				ytitle("Incentivized", orientation(vertical) size(medium)) 														///
				xlabel(0.1 "10%" 0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%" 0.7 "70%" 0.8 "80%")							///
				xtitle("Probability of correct interpretation of data") 														///
				title("")																										///
				name(botleft2, replace) scheme(plotplain)
graph close
drop p4 p5 
*------------------------------------------------------------------------------------------------------------------------------
* GRAPH8: BOTTOM-RIGHT Graph
* Graph below is the incentives high numeracy graph that will be in the bottom-right of the four graphs
* High Numeracy, Incentive=1
* For the three simulations below: num=1 out 6 questions correctly solved, numeracy=-1.666, incentive =0

* Congenial = -2
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy 1.666 congenial -2 num_con -3.332 numsq 2.776 numsq_con -5.552 incentive 1 in_con -2 in_num 1.666 in_numsq 2.776 in_num_con -3.332 in_numsq_con -5.552 if order_num_treat == 0
simqi, prval(1) genpr(p4)
drop b*

* Congenial = +2
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy 1.666 congenial 2 num_con 3.332 numsq 2.776 numsq_con 5.552 incentive 1 in_con 2 in_num 1.666 in_numsq 2.776 in_num_con 3.332 in_numsq_con 5.552 if order_num_treat == 0
simqi, prval(1) genpr(p5)
drop b*

*-------------------------------------------------------GRAPH8-----------------------------------------------------------------
graph twoway 	(kdensity p4, lcolor(dknavy) lwidth(medthick) text(7 0.20 "Congenial = -2", color (dknavy) size(small)))		///
				(kdensity p5, lcolor(dkorange) lwidth(medthick) text(7 0.61 "Congenial = +2", color (dkorange) size(small)))	/// 
				,legend(off)																									///
				ylabel("")																										///
				ytitle("") 																										///
				xlabel(0.1 "10%" 0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%" 0.7 "70%" 0.8 "80%")							///
				xtitle("Probability of correct interpretation of data") 														///
				title("")																										///
				name(botright2, replace) scheme(plotplain)
graph close
drop p4 p5
*------------------------------------------------------------------------------------------------------------------------------
*----------------------------------------------------- GRAPH COMBINE-----------------------------------------------------------
graph combine topleft2 topright2 botleft2 botright2, xcommon scheme(plotplain)
graph export "${main_appendix}/Figure_A2.png", replace
graph close
*------------------------------------------------------------------------------------------------------------------------------
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Table A21: Differences in the predicted congeniality bias
*-------------------------------------------------------------------------------
* The program "Clarify" is necessary to run these simulations.
* Please see "Clarify: Software for Interpreting and Presenting Statistical Results" (Tomz, Wittenberg, and King; 2001) for your reference.
********************************************************************************
* Model SD 1
********************************************************************************
* Simulation 1
* No incentive and Low numeracy
* Incentive = 0 and Numeracy = -1.666
* Congenial = -1 for conservative and Congenial = +1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy -1.666 congenial 1 num_con -1.666 numsq 2.776 numsq_con 2.776 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -1.666 1.666 numsq_con 2.776 -2.776) pr 
drop b*
*-------------------------------------------------------------------------------
* Simulation 2
* No incentive and High numeracy
* Incentive = 0 and Numeracy = 1.666
* Congenial = -1 for conservative and Congenial = +1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy 1.666 congenial 1 num_con 1.666 numsq 2.776 numsq_con 2.776 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 1.666 -1.666 numsq_con 2.776 -2.776) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 3
* Incentive and Low numeracy
* Incentive = 1 and Numeracy= -1.666
* Congenial = +1 for conservative and Congenial = -1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy -1.666 congenial 1 num_con -1.666 numsq 2.776 numsq_con 2.776 incentive 1 in_con 1 in_num -1.666 in_numsq 2.776 in_num_con -1.666 in_numsq_con 2.776 if order_num_treat == 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -1.666 1.666 numsq_con 2.776 -2.776 in_con 1 -1 in_num_con -1.666 1.666 in_numsq_con 2.776 -2.776) pr
drop b*
***********************************************************************************************************************
* Simulation 4
* Incentive and High numeracy
* Incentive = 1 and Numeracy = 1.666
* Congenial = +1 for conservative and Congenial = -1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy 1.666 congenial 1 num_con 1.666 numsq 2.776 numsq_con 2.776 incentive 1 in_con 1 in_num 1.666 in_numsq 2.776 in_num_con 1.666 in_numsq_con 2.776 if order_num_treat == 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 1.666 -1.666 numsq_con 2.776 -2.776 in_con 1 -1 in_num_con 1.666 -1.666 in_numsq_con 2.776 -2.776) pr
drop b*
********************************************************************************
*Model SD 1.5
********************************************************************************
* Simulation 5
* No incentive and Low numeracy
* Incentive = 0 and Numeracy = -2.499 
* Congenial = -1 for conservative and Congenial = +1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy -2.499 congenial 1 num_con -2.499 numsq 6.245 numsq_con 6.245 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -2.499 2.499 numsq_con 6.245 -6.245) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 6
* No incentive and High numeracy
* Incentive = 0 and Numeracy = 2.499
* Congenial = -1 for conservative and Congenial = +1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy 2.499 congenial 1 num_con 2.499 numsq 6.245 numsq_con 6.245 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 2.499 -2.499 numsq_con 6.245 -6.245) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 7
* Incentive and Low numeracy
* Incentive = 1 and Numeracy= -2.499
* Congenial = +1 for conservative and Congenial = -1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy -2.499 congenial 1 num_con -2.499 numsq 6.245 numsq_con 6.245 incentive 1 in_con 1 in_num -2.499 in_numsq 6.245 in_num_con -2.499 in_numsq_con 6.245 if order_num_treat == 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -2.499 2.499 numsq_con 6.245 -6.245 in_con 1 -1 in_num_con -2.499 2.499 in_numsq_con 6.245 -6.245) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 8
* Incentive and High numeracy
* Incentive = 1 and Numeracy= 2.499
* Congenial = +1 for conservative and Congenial = -1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy 2.499 congenial 1 num_con 2.499 numsq 6.245 numsq_con 6.245 incentive 1 in_con 1 in_num 2.499 in_numsq 6.245 in_num_con 2.499 in_numsq_con 6.245 if order_num_treat == 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 2.499 -2.499 numsq_con 6.245 -6.245 in_con 1 -1 in_num_con 2.499 -2.499 in_numsq_con 6.245 -6.245) pr
drop b*
********************************************************************************
*Model SD 2
********************************************************************************
* Simulation 9
* No incentive and Low numeracy
* Incentive = 0 and Numeracy= -3.332
* Congenial = -1 for conservative and Congenial = +1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy -3.332 congenial 1 num_con -3.332 numsq 11.102 numsq_con 11.102 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -3.332 3.332 numsq_con 11.102 -11.102) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 10
* No incentive and High numeracy
* Incentive = 0 and Numeracy= 3.332
* Congenial = -1 for conservative and Congenial = +1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy 3.332 congenial 1 num_con 3.332 numsq 11.102 numsq_con 11.102 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 3.332 -3.332 numsq_con 11.102 -11.102) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 11
* Incentive and Low numeracy
* Incentive = 1 and Numeracy= -3.332 
* Congenial = +1 for conservative and Congenial = -1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy -3.332 congenial 1 num_con -3.332 numsq 11.102 numsq_con 11.102 incentive 1 in_con 1 in_num -3.332 in_numsq 11.102 in_num_con -3.332 in_numsq_con 11.102 if order_num_treat == 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -3.332 3.332 numsq_con 11.102 -11.102 in_con 1 -1 in_num_con -3.332 3.332 in_numsq_con 11.102 -11.102) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 12
* Incentive and High numeracy
* Incentive = 1 and Numeracy = 3.332
* Congenial = +1 for conservative and Congenial = -1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 0, r
setx numeracy 3.332 congenial 1 num_con 3.332 numsq 11.102 numsq_con 11.102 incentive 1 in_con 1 in_num 3.332 in_numsq 11.102 in_num_con 3.332 in_numsq_con 11.102 if order_num_treat == 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 3.332 -3.332 numsq_con 11.102 -11.102 in_con 1 -1 in_num_con 3.332 -3.332 in_numsq_con 11.102 -11.102) pr
drop b*
*-------------------------------------------------------------------------------
****The results from the t-test below are used to create Table A21 manually in latex.
*-------------------------------------------------------------------------------


*Simulation1/2 SD1 No-incentive - Low vs High Numeracy
ttesti 1000 -.1227667 2.017394  1000 -.1978073 1.998177  

*Simulation3/4 SD1 Incentive - Low vs High Numeracy
ttesti 1000 -.0201621 1.392917  1000 -.0756817 1.321614

*Simulation5/6 SD1.5 No-incentive - Low vs High Numeracy
ttesti 1000 -.1380292 3.519697  1000 -.2516904 2.808659

*Simulation7/8 SD1.5 Incentive - Low vs High Numeracy
ttesti 1000 -.0219124 2.350107  1000 -.1063465 1.781618

*Simulation9/10 SD2 No-incentive - Low vs High Numeracy
ttesti 1000 -.1611592 5.818490  1000 -.3146121 4.461857

*Simulation11/12 SD2 Incentive - Low vs High Numeracy
ttesti 1000 -.0293333 3.920864  1000 -.1421504 2.928702
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Split sample analyses - Numeracy *BEFORE* treatment
* Table A22: The impact of numeracy and congeniality on accuracy
* Table A23: The impatc of incentive, numeracy, and congeniality on accuracy
* Figure A3: Predicted probabilities of correctly interpreting the data (-1,0,1SD)
* Figure A4: Predicted probabilities of correctly interpreting the data (2SD)
* Table A24: Differences in the predicted congeneity bias
*-------------------------------------------------------------------------------
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Table A22: The impact of numeracy and congeniality on accuracy
*-------------------------------------------------------------------------------
* Numeracy is measured before (order_num_treat == 1)
* Equation 1 (without control variables) - Table A22 (1)
reg correct congenial numeracy numsq if incentive==0 & order_num_treat==1, r
estadd local Controls "No"
est store a1

* Equation 1 (with control variables) - Table A22 (2)
reg correct congenial numeracy numsq age i.gender i.race i.edu i.vote2016 if incentive==0 & order_num_treat==1, r
estadd local Controls "Yes"
est store a2

* Equation 2 (without control variables) - Table A22 (3)
reg correct congenial numeracy numsq num_con c.numsq#c.congenial  if incentive==0 & order_num_treat==1, r
estadd local Controls "No"
est store a3

* Equation 2 (with control variables) - Table A22 (4)
reg correct congenial numeracy numsq num_con c.numsq#c.congenial age i.gender i.race i.edu i.vote2016 if incentive==0 & order_num_treat==1, r
estadd local Controls "Yes"
est store a4

* Export Table A22 in Latex
esttab  a1 a2 a3 a4 using "${main_appendix}/Table_A22.tex" ,  ///
		nonumbers mtitles("(1)" "(2)" "(3)" "(4)") b(3) star(* 0.10 ** 0.05  *** 0.01) se(3) ar2  label  ///
		replace 	///
		drop(age *gender* *race* *edu* *vote2016*) /// 
		scalars("Controls") ///
		tex addnotes("Note:Linear Probability Model with heterscedasticity robust standard errors." "Control variables in the regression are age, gender, race, education, and voting2016")
eststo clear
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Table A23: The impact of incentive, numeracy, and congeniality on accuracy
*-------------------------------------------------------------------------------
* Numeracy is measured before (order_num_treat == 1)
* Equation 3 (without control variables) - Table A23 (5)
reg correct incentive if order_num_treat==1, r
estadd local Controls "No"
est store a5

* Equation 3 (with control variables) - Table A23 (6)
reg correct incentive age i.gender i.race i.edu i.vote2016 if order_num_treat==1, r
estadd local Controls "Yes"
est store a6

* Equation 4 (excl. 2 variables) (without control variables) - Table A23 (7)
reg correct numeracy congenial num_con numsq c.numsq#c.congenial incentive in_con in_num in_num_con if order_num_treat==1, r
estadd local Controls "No"
est store a7

* Equation 4 (excl. 2 variables) (with control variables) - Table A23 (8)
reg correct  congenial numeracy num_con numsq c.numsq#c.congenial incentive in_con in_num in_num_con age i.gender i.race i.edu i.vote2016 if order_num_treat==1, r
estadd local Controls "Yes"
est store a8

* Equation 4 (without control variables) - Table A23 (9)
reg correct  congenial numeracy num_con numsq c.numsq#c.congenial incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat==1, r
estadd local Controls "No"
est store a9

* Equation 4 (without control variables) - Table A23 (10)
reg correct  congenial numeracy num_con numsq c.numsq#c.congenial incentive in_con in_num in_numsq in_num_con in_numsq_con age i.gender i.race i.edu i.vote2016 if order_num_treat==1, r
estadd local Controls "Yes"
est store a10

* Export Table A23 in Latex
esttab  a5 a6 a7 a8 a9 a10 using "${main_appendix}/Table_A23.tex" ,  ///
		nonumbers mtitles("(5)" "(6)" "(7)" "(8)" "(9)" "(10)") b(3) star(* 0.10 ** 0.05  *** 0.01) se(3) ar2 label  ///
		replace 	///
		drop(age *gender* *race* *edu* *vote2016*) /// 
		scalars("Controls") ///
		tex addnotes("Note:Linear Probability Model with heterscedasticity robust standard errors." "Control variables in the regression are age, gender, race, education, and voting2016")					
eststo clear
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Figure A3: Predicted probabilities of correctly interpreting the data (-1,0,1SD)
*-------------------------------------------------------------------------------
* The program "Clarify" is necessary to run these simulations.
* Please see "Clarify: Software for Interpreting and Presenting Statistical Results" (Tomz, Wittenberg, and King; 2001) for your reference.
*-------------------------------------------------------------------------------
* GRAPH1: TOP-LEFT Graph (Non-incentivized & Low numeracy)
* Graph below is the no-incentives low numeracy graph that will be in the top-left of the four graphs
* Low Numeracy, Incentive=0
* For the three simulations below: num=1 out 6 questions correctly solved, numeracy=-1.641, incentive =0

* Congenial = -1
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy -1.641 congenial -1 num_con 1.641 numsq 2.693 numsq_con -2.693 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 1
simqi, prval(1) genpr(p1)
drop b*

* Congenial = +1
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy -1.641 congenial 1 num_con -1.641 numsq 2.693 numsq_con 2.693 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 1
simqi, prval(1) genpr(p2)
drop b*

* Congenial = 0
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy -1.641 congenial 0 num_con 0 numsq 2.693 numsq_con 0 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 1
simqi, prval(1) genpr(p3)
drop b*

sum p1 p2 p3
*-------------------------------------------------------GRAPH1-----------------------------------------------------------------
graph twoway 	(kdensity p1, lcolor(orange) lwidth(medthick) text(8 0.56 "Congenial = -1", color (orange) size(small)))	///
				(kdensity p2, lcolor(green) lwidth(medthick) text(8 0.33 "Congenial = +1", color (green) size(small)))		/// 
				(kdensity p3, lcolor(gs5) lwidth(medthick) text(12 0.53 "Congenial = 0", color (gs5) size(small)))			///
				,legend(off)																								///
				ylabel("")																									///
				ytitle("Non-Incentivized", orientation(vertical) size(medium)) 												///
				xlabel(0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%" 0.7 "70%") 										///
				xtitle("") 																									///
				title("Low numeracy", size (medium))																		///
				name(topleft1, replace) scheme(plotplain)
graph close
drop p1 p2 p3
*------------------------------------------------------------------------------------------------------------------------------
* GRAPH2: TOP-RIGHT Graph (Non-incentivized & High numeracy)
* Graph below is the no-incentives high numeracy graph that will be in the top-right of the four graphs
* High Numeracy, Incentive=0
* For the three simulations below: num=4.35 out 6 questions correctly solved, numeracy=+1.641, incentive =0

* Congenial = -1
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy 1.641 congenial -1 num_con -1.641 numsq 2.693 numsq_con -2.693 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 1
simqi, prval(1) genpr(p1)
drop b*

* Congenial = +1
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy 1.641 congenial 1 num_con 1.641 numsq 2.693 numsq_con 2.693 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 1
simqi, prval(1) genpr(p2)
drop b*

* Congenial = 0
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy 1.641 congenial 0 num_con 0 numsq 2.693 numsq_con 0 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 1
simqi, prval(1) genpr(p3)
drop b*

sum p1 p2 p3
*-------------------------------------------------------GRAPH2-----------------------------------------------------------------
graph twoway 	(kdensity p1, lcolor(orange) lwidth(medthick) text(8 0.33 "Congenial = -1", color (orange) size(small))) 	///
				(kdensity p2, lcolor(green) lwidth(medthick) text(9.5 0.57 "Congenial = +1", color (green) size(small)))	/// 
				(kdensity p3, lcolor(gs5) lwidth(medthick) text(11 0.41 "Congenial = 0", color (gs5) size(small)))			///
				,legend(off)																								///
				ylabel("")																									///
				ytitle("") 																									///
				xlabel(0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%" 0.7 "70%") 										///
				xtitle("") 																									///
				title("High numeracy", size (medium))																		///
				name(topright1, replace) scheme(plotplain)
graph close
drop p1 p2 p3
*------------------------------------------------------------------------------------------------------------------------------
* GRAPH3: BOTTOM-LEFT Graph (Incentivized & Low numeracy)
* Graph below is the incentives low numeracy graph that will be in the bottom-left of the four graphs
* Low Numeracy, Incentive=1
* For the three simulations below: num=1 out 6 questions correctly solved, numeracy=-1.641, incentive =1

* Congenial = -1
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy -1.641 congenial -1 num_con 1.641 numsq 2.693 numsq_con -2.693 incentive 1 in_con -1 in_num -1.641 in_numsq 2.693 in_num_con 1.641 in_numsq_con -2.693 if order_num_treat == 1
simqi, prval(1) genpr(p1)
drop b*

* Congenial = +1
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy -1.641 congenial 1 num_con -1.641 numsq 2.693 numsq_con 2.693 incentive 1 in_con 1 in_num -1.641 in_numsq 2.693 in_num_con -1.641 in_numsq_con 2.693 if order_num_treat == 1
simqi, prval(1) genpr(p2)
drop b*

* Congenial = 0
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy -1.641 congenial 0 num_con 0 numsq 2.693 numsq_con 0 incentive 1 in_con 0 in_num -1.641 in_numsq 2.693 in_num_con 0 in_numsq_con 0 if order_num_treat == 1
simqi, prval(1) genpr(p3)
drop b*

sum p1 p2 p3
*-------------------------------------------------------GRAPH3-----------------------------------------------------------------
graph twoway 	(kdensity p1, lcolor(orange) lwidth(medthick) text(11 0.52 "Congenial = -1", color (orange) size(small)))	///
				(kdensity p2, lcolor(green) lwidth(medthick) text(9 0.30 "Congenial = +1", color (green) size(small)))		/// 
				(kdensity p3, lcolor(gs5) lwidth(medthick) text(15 0.50 "Congenial = 0", color (gs5) size(small)))			///
				,legend(off)																								///
				ylabel("")																									///
				ytitle("  Incentivized  ", orientation(vertical) size(medium))												///
				xlabel(0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%" 0.7 "70%") 										///
				xtitle("Probability of correct interpretation of data") 													///
				title("")																									///
				name(botleft1, replace) scheme(plotplain)
graph close
drop p1 p2 p3
*------------------------------------------------------------------------------------------------------------------------------
* GRAPH4: BOTTOM-RIGHT Graph (Incentivized & High numeracy)
* Graph below is the incentives high numeracy graph that will be in the bottom-right of the four graphs.*/
* High Numeracy, Incentive=1*/
* For the three simulations below: num=4.35 out 6 questions correctly solved, numeracy=1.641, incentive =1*/

* Congenial = -1
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy 1.641 congenial -1 num_con -1.641 numsq 2.693 numsq_con -2.693 incentive 1 in_con -1 in_num 1.641 in_numsq 2.693 in_num_con -1.641 in_numsq_con -2.693 if order_num_treat == 1
simqi, prval(1) genpr(p1)
drop b*

* Congenial = +1
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy 1.641 congenial 1 num_con 1.641 numsq 2.693 numsq_con 2.693 incentive 1 in_con 1 in_num 1.641 in_numsq 2.693 in_num_con 1.641 in_numsq_con 2.693 if order_num_treat == 1
simqi, prval(1) genpr(p2)
drop b*

* Congenial = 0
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy 1.641 congenial 0 num_con 0 numsq 2.693 numsq_con 0 incentive 1 in_con 0 in_num 1.641 in_numsq 2.693 in_num_con 0 in_numsq_con 0 if order_num_treat == 1
simqi, prval(1) genpr(p3)
drop b*

sum p1 p2 p3
*-------------------------------------------------------GRAPH4-----------------------------------------------------------------
graph twoway 	(kdensity p1, lcolor(orange) lwidth(medthick) text(10 0.35 "Congenial = -1", color (orange) size(small)))	///
				(kdensity p2, lcolor(green) lwidth(medthick) text(13 0.58 "Congenial = +1", color (green) size(small)))		/// 
				(kdensity p3, lcolor(gs5) lwidth(medthick) text(15 0.42 "Congenial = 0", color (gs5) size(small)))			///
				,legend(off)																								///
				ylabel("")																									///
				ytitle("")																									///
				xlabel(0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%" 0.7 "70%") 										///
				xtitle("Probability of correct interpretation of data") 													///
				title("")																									///
				name(botright1, replace) scheme(plotplain)
graph close
drop p1 p2 p3
*------------------------------------------------------------------------------------------------------------------------------
*----------------------------------------------------- GRAPH COMBINE-----------------------------------------------------------
graph combine topleft1 topright1 botleft1 botright1, xcommon scheme(plotplain)
graph export "${main_appendix}/Figure_A3.png", replace
graph close
*------------------------------------------------------------------------------------------------------------------------------
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Figure A4: Predicted probabilities of correctly interpreting the data (2SD)
*-------------------------------------------------------------------------------
* GRAPH5: TOP-LEFT Graph
* Graph below is the no-incentives low numeracy graph that will be in the top-left of the four graphs
* Low Numeracy, Incentive=0
* For the three simulations below: num=1 out 6 questions correctly solved, numeracy=-1.641, incentive =0

* Congenial = -2
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy -1.641 congenial -2 num_con 3.282 numsq 2.693 numsq_con -5.386 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 1
simqi, prval(1) genpr(p4)
drop b*

* Congenial = +2
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy -1.641 congenial 2 num_con -3.282 numsq 2.693 numsq_con 5.386 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 1
simqi, prval(1) genpr(p5)
drop b*

*-------------------------------------------------------GRAPH5-----------------------------------------------------------------
graph twoway 	(kdensity p4, lcolor(dknavy) lwidth(medthick) text(5.3 0.57 "Congenial = -2", color (dknavy) size(small)))		///
				(kdensity p5, lcolor(dkorange) lwidth(medthick) text(5 0.26 "Congenial = +2", color (dkorange) size(small)))	/// 
				,legend(off)																									///
				ylabel("")																										///
				ytitle("Non-Incentivized", orientation(vertical) size(medium)) 													///
				xlabel(0.1 "10%" 0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%" 0.7 "70%" 0.8 "80%")							///
				xtitle("") 																										///
				title("Low numeracy", size (medium))																			///
				name(topleft2, replace) scheme(plotplain)
graph close
drop p4 p5 
*------------------------------------------------------------------------------------------------------------------------------
* GRAPH6: TOP-RIGHT Graph
* Graph below is the no-incentives high numeracy graph that will be in the top-right of the four graphs
* High Numeracy, Incentive=0
* For the three simulations below: num=1 out 6 questions correctly solved, numeracy=+1.641, incentive =0

* Congenial = -2
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy 1.641 congenial -2 num_con -3.282 numsq 2.693 numsq_con -5.386 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 1
simqi, prval(1) genpr(p4)
drop b*

* Congenial = +2
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy 1.641 congenial 2 num_con 3.282 numsq 2.693 numsq_con 5.386 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 1
simqi, prval(1) genpr(p5)
drop b*

*-------------------------------------------------------GRAPH6-----------------------------------------------------------------
graph twoway 	(kdensity p4, lcolor(dknavy) lwidth(medthick) text(5 0.23 "Congenial = -2", color (dknavy) size(small)))		///
				(kdensity p5, lcolor(dkorange) lwidth(medthick) text(5.2 0.48 "Congenial = +2", color (dkorange) size(small)))	/// 
				,legend(off)																									///
				ylabel("")																										///
				ytitle("") 																										///
				xlabel(0.1 "10%" 0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%" 0.7 "70%" 0.8 "80%")							///
				xtitle("") 																										///
				title("High numeracy", size (medium))																			///
				name(topright2, replace) scheme(plotplain)
graph close
drop p4 p5 
*------------------------------------------------------------------------------------------------------------------------------
* GRAPH7: BOTTOM-LEFT Graph
* Graph below is the incentives low numeracy graph that will be in the bottom-left of the four graphs
* Low Numeracy, Incentive=1
* For the three simulations below: num=1 out 6 questions correctly solved, numeracy=-1.641, incentive =0

* Congenial = -2
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy -1.641 congenial -2 num_con 3.282 numsq 2.693 numsq_con -5.386 incentive 1 in_con -2 in_num -1.641 in_numsq 2.693 in_num_con 3.282 in_numsq_con -5.386 if order_num_treat == 1
simqi, prval(1) genpr(p4)
drop b*

* Congenial = +2
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy -1.641 congenial 2 num_con -3.282 numsq 2.693 numsq_con 5.386 incentive 1 in_con 2 in_num -1.641 in_numsq 2.693 in_num_con -3.282 in_numsq_con 5.386 if order_num_treat == 1
simqi, prval(1) genpr(p5)
drop b*

*-------------------------------------------------------GRAPH7-----------------------------------------------------------------
graph twoway 	(kdensity p4, lcolor(dknavy) lwidth(medthick) text(7 0.58 "Congenial = -2", color (dknavy) size(small)))		///
				(kdensity p5, lcolor(dkorange) lwidth(medthick) text(7 0.25 "Congenial = +2", color (dkorange) size(small)))	/// 
				,legend(off)																									///
				ylabel("")																										///
				ytitle("Incentivized", orientation(vertical) size(medium)) 														///
				xlabel(0.1 "10%" 0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%" 0.7 "70%" 0.8 "80%")							///
				xtitle("Probability of correct interpretation of data") 														///												///
				title("")																										///
				name(botleft2, replace) scheme(plotplain)
graph close
drop p4 p5 
*------------------------------------------------------------------------------------------------------------------------------
* GRAPH8: BOTTOM-RIGHT Graph
* Graph below is the incentives high numeracy graph that will be in the bottom-right of the four graphs
* High Numeracy, Incentive=1
* For the three simulations below: num=1 out 6 questions correctly solved, numeracy=-1.641, incentive =0

* Congenial = -2
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy 1.641 congenial -2 num_con -3.282 numsq 2.693 numsq_con -5.386 incentive 1 in_con -2 in_num 1.641 in_numsq 2.693 in_num_con -3.282 in_numsq_con -5.386 if order_num_treat == 1
simqi, prval(1) genpr(p4)
drop b*

* Congenial = +2
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy 1.641 congenial 2 num_con 3.282 numsq 2.693 numsq_con 5.386 incentive 1 in_con 2 in_num 1.641 in_numsq 2.693 in_num_con 3.282 in_numsq_con 5.386 if order_num_treat == 1
simqi, prval(1) genpr(p5)
drop b*

*-------------------------------------------------------GRAPH8-----------------------------------------------------------------
graph twoway 	(kdensity p4, lcolor(dknavy) lwidth(medthick) text(6 0.24 "Congenial = -2", color (dknavy) size(small)))		///
				(kdensity p5, lcolor(dkorange) lwidth(medthick) text(7 0.50 "Congenial = +2", color (dkorange) size(small)))	/// 
				,legend(off)																									///
				ylabel("")																										///
				ytitle("") 																										///
				xlabel(0.1 "10%" 0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%" 0.7 "70%" 0.8 "80%")							///
				xtitle("Probability of correct interpretation of data") 														///												///
				title("")																										///
				name(botright2, replace) scheme(plotplain)
graph close
drop p4 p5 
*------------------------------------------------------------------------------------------------------------------------------
*----------------------------------------------------- GRAPH COMBINE-----------------------------------------------------------
graph combine topleft2 topright2 botleft2 botright2, xcommon scheme(plotplain)
graph export "${main_appendix}/Figure_A4.png", replace
graph close
*------------------------------------------------------------------------------------------------------------------------------
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Table A24: Differences in the predicted congeniality bias
*-------------------------------------------------------------------------------
*-------------------------------------------------------------------------------
* The program "Clarify" is necessary to run these simulations.
* Please see "Clarify: Software for Interpreting and Presenting Statistical Results" (Tomz, Wittenberg, and King; 2001) for your reference.
*-------------------------------------------------------------------------------

********************************************************************************
* Model SD 1
********************************************************************************
* Simulation 1
* No incentive and Low numeracy
* Incentive = 0 and Numeracy = -1.641
* Congenial = -1 for conservative and Congenial = +1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy -1.641 congenial 1 num_con -1.641 numsq 2.693 numsq_con 2.693 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 1
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -1.641 1.641 numsq_con 2.693 -2.693) pr 
drop b*
*-------------------------------------------------------------------------------
* Simulation 2
* No incentive and High numeracy
* Incentive = 0 and Numeracy = 1.641
* Congenial = -1 for conservative and Congenial = +1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy 1.641 congenial 1 num_con 1.641 numsq 2.693 numsq_con 2.693 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 1
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 1.641 -1.641 numsq_con 2.693 -2.693) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 3
* Incentive and Low numeracy
* Incentive = 1 and Numeracy= -1.641
* Congenial = +1 for conservative and Congenial = -1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy -1.641 congenial 1 num_con -1.641 numsq 2.693 numsq_con 2.693 incentive 1 in_con 1 in_num -1.641 in_numsq 2.693 in_num_con -1.641 in_numsq_con 2.693 if order_num_treat == 1
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -1.641 1.641 numsq_con 2.693 -2.693 in_con 1 -1 in_num_con -1.641 1.641 in_numsq_con 2.693 -2.693) pr
drop b*
***********************************************************************************************************************
* Simulation 4
* Incentive and High numeracy
* Incentive = 1 and Numeracy = 1.641
* Congenial = +1 for conservative and Congenial = -1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy 1.641 congenial 1 num_con 1.641 numsq 2.693 numsq_con 2.693 incentive 1 in_con 1 in_num 1.641 in_numsq 2.693 in_num_con 1.641 in_numsq_con 2.693 if order_num_treat == 1
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 1.641 -1.641 numsq_con 2.693 -2.693 in_con 1 -1 in_num_con 1.641 -1.641 in_numsq_con 2.693 -2.693) pr
drop b*
********************************************************************************
*Model SD 1.5
********************************************************************************
* Simulation 5
* No incentive and Low numeracy
* Incentive = 0 and Numeracy = -2.462
* Congenial = -1 for conservative and Congenial = +1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy -2.462 congenial 1 num_con -2.462 numsq 6.061 numsq_con 6.061 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 1
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -2.462 2.462 numsq_con 6.061 -6.061) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 6
* No incentive and High numeracy
* Incentive = 0 and Numeracy = 2.462
* Congenial = -1 for conservative and Congenial = +1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy 2.462 congenial 1 num_con 2.462 numsq 6.061 numsq_con 6.061 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 1
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 2.462 -2.462 numsq_con 6.061 -6.061) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 7
* Incentive and Low numeracy
* Incentive = 1 and Numeracy= -2.462
* Congenial = +1 for conservative and Congenial = -1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy -2.462 congenial 1 num_con -2.462 numsq 6.061 numsq_con 6.061 incentive 1 in_con 1 in_num -2.462 in_numsq 6.061 in_num_con -2.462 in_numsq_con 6.061 if order_num_treat == 1
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -2.462 2.462 numsq_con 6.061 -6.061 in_con 1 -1 in_num_con -2.462 2.462 in_numsq_con 6.061 -6.061) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 8
* Incentive and High numeracy
* Incentive = 1 and Numeracy= 2.462
* Congenial = +1 for conservative and Congenial = -1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy 2.462 congenial 1 num_con 2.462 numsq 6.061 numsq_con 6.061 incentive 1 in_con 1 in_num 2.462 in_numsq 6.061 in_num_con 2.462 in_numsq_con 6.061 if order_num_treat == 1
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 2.462 -2.462 numsq_con 6.061 -6.061 in_con 1 -1 in_num_con 2.462 -2.462 in_numsq_con 6.061 -6.061) pr
drop b*
********************************************************************************
*Model SD 2
********************************************************************************
* Simulation 9
* No incentive and Low numeracy
* Incentive = 0 and Numeracy= -3.282
* Congenial = -1 for conservative and Congenial = +1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy -3.282 congenial 1 num_con -3.282 numsq 10.772 numsq_con 10.772 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 1
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -3.282 3.282 numsq_con 10.772 -10.772) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 10
* No incentive and High numeracy
* Incentive = 0 and Numeracy= 3.282
* Congenial = -1 for conservative and Congenial = +1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy 3.282 congenial 1 num_con 3.282 numsq 10.772 numsq_con 10.772 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0 if order_num_treat == 1
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 3.282 -3.282 numsq_con 10.772 -10.772) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 11
* Incentive and Low numeracy
* Incentive = 1 and Numeracy= -3.282
* Congenial = +1 for conservative and Congenial = -1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy -3.282 congenial 1 num_con -3.282 numsq 10.772 numsq_con 10.772 incentive 1 in_con 1 in_num -3.282 in_numsq 10.772 in_num_con -3.282 in_numsq_con 10.772 if order_num_treat == 1
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -3.282 3.282 numsq_con 10.772 -10.772 in_con 1 -1 in_num_con -3.282 3.282 in_numsq_con 10.772 -10.772) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 12
* Incentive and High numeracy
* Incentive = 1 and Numeracy = 3.282
* Congenial = +1 for conservative and Congenial = -1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con if order_num_treat == 1, r
setx numeracy 3.282 congenial 1 num_con 3.282 numsq 10.772 numsq_con 10.772 incentive 1 in_con 1 in_num 3.282 in_numsq 10.772 in_num_con 3.282 in_numsq_con 10.772 if order_num_treat == 1
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 3.282 -3.282 numsq_con 10.772 -10.772 in_con 1 -1 in_num_con 3.282 -3.282 in_numsq_con 10.772 -10.772) pr
drop b*
*-------------------------------------------------------------------------------
****The results from the t-test below are used to create Table A24 manually in latex.
*-------------------------------------------------------------------------------
*Simulation1/2 SD1 No-incentive - Low vs High Numeracy
ttesti 1000 .0536047 2.103876  1000 -.1161485 2.11446  

*Simulation3/4 SD1 Incentive - Low vs High Numeracy
ttesti 1000 .0471925 1.464353  1000 -.1137994 1.484079

*Simulation5/6 SD1.5 No-incentive - Low vs High Numeracy
ttesti 1000 .1755068 3.487493  1000 -.0745441 2.754565

*Simulation7/8 SD1.5 Incentive - Low vs High Numeracy
ttesti 1000 .0800150 2.51796  1000 -.1588158 2.001219

*Simulation9/10 SD2 No-incentive - Low vs High Numeracy
ttesti 1000 .3118046 5.314862  1000 .0001605 4.315826

*Simulation11/12 SD2 Incentive - Low vs High Numeracy
ttesti 1000 .108679 4.203793  1000 -.2014686 3.212454
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Analysis with no deviations from pre-registration
* Multivariate analyses
* Table A25: The impact of numeracy and congeniality on accuracy (unincentivized)
* Table A26: The impact of incentives, numeracy and congeneity on accuracy (all)
* Figure A5: Predicted probabilities of correctly interpreting the data
* Table A27: Difference in the exhibited congeniality bias
*-------------------------------------------------------------------------------
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Table A25: The impact of numeracy and congeniality on accuracy (unincentivized)
*-------------------------------------------------------------------------------
* Equation 1 (without control variables) - Table A25 (1)
reg correct numeracy congenial num_con numsq if incentive==0, r
estadd local Controls "No"
est store a1

* Equation 1 (with control variables) - Table A25 (2)
reg correct numeracy congenial num_con numsq age i.gender i.race i.edu i.vote2016 if incentive==0, r
estadd local Controls "Yes"
est store a2

* Export Table A25 in Latex
esttab  a1 a2 using "${main_appendix}/Table_A25.tex" ,  ///
		nonumbers  b(3) star(* 0.10 ** 0.05  *** 0.01) se(3) label  ///
		title(Testing Hypotheses 1 and 2) replace 	///
		drop(age *gender* *race* *edu* *vote2016*) /// 
		scalars("Controls") ///
		tex addnotes(Note:Linear Probability Model with heterscedasticity robust standard errors.)
eststo clear
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Table A26: The impact of incentives, numeracy and congeneity on accuracy (all)
*------------------------------------------------------------------------------- 
* Equation 2 (without control variables) - Table A26 (3)
reg correct incentive, r
estadd local Controls "No"
est store a3

* Equation 2 (with control variables) - Table A26 (4)
reg correct incentive age i.gender i.race i.edu i.vote2016, r
estadd local Controls "Yes"
est store a4

* Equation 3 (without control variables) - Table A26 (5)
reg correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
estadd local Controls "No"
est store a5

* Equation 3 (with control variables) - Table A26 (6)
reg correct numeracy congenial num_con numsq incentive in_con in_num in_num_con age i.gender i.race i.edu i.vote2016, r
estadd local Controls "Yes"
est store a6

* Export Table A26 in Latex
esttab  a3 a4 a5 a6 using "${main_appendix}/Table_A26.tex" ,  ///
		nonumbers  b(3) star(* 0.10 ** 0.05  *** 0.01) se(3) label  ///
		title(Testing Hypothesis 3 and 4) replace 	///
		drop(age *gender* *race* *edu* *vote2016*) /// 
		scalars("Controls") ///
		tex addnotes(Note:Linear Probability Model with heterscedasticity robust standard errors.)
eststo clear
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Figure A5: Predicted probabilities of correctly interpreting the data
*-------------------------------------------------------------------------------
* GRAPH1: TOP-LEFT Graph (Non-incentivized & Low numeracy)
* Graph below is the no-incentives low numeracy graph that will be in the top-left of the four graphs
* Low Numeracy, Incentive=0
* For the three simulations below: num=1 out 6 questions correctly solved, numeracy=-1.654, incentive =0

* Congenial = -1
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy -1.654 congenial -1 num_con 1.654 numsq 2.736 incentive 0 in_con 0 in_num 0 in_num_con 0
simqi, prval(1) genpr(p1)
drop b*

* Congenial = +1
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy -1.654 congenial 1 num_con -1.654 numsq 2.736 incentive 0 in_con 0 in_num 0 in_num_con 0
simqi, prval(1) genpr(p2)
drop b*

* Congenial = 0
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy -1.654 congenial 0 num_con 0 numsq 2.736 incentive 0 in_con 0 in_num 0 in_num_con 0
simqi, prval(1) genpr(p3)
drop b*

sum p1 p2 p3
*-------------------------------------------------------GRAPH1-----------------------------------------------------------------
graph twoway 	(kdensity p1, lcolor(orange) lwidth(medthick) text(10 0.33 "Congenial = -1", color (orange) size(small)))	///
				(kdensity p2, lcolor(green) lwidth(medthick) text(9 0.54 "Congenial = +1", color (green) size(small)))		/// 
				(kdensity p3, lcolor(gs5) lwidth(medthick) text(16 0.50 "Congenial = 0", color (gs5) size(small)))			///
				,legend(off)																								///
				ylabel("")																									///
				ytitle("Non-Incentivized", orientation(vertical) size(large)) 												///
				xlabel(0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%") 													///
				xtitle("") 																									///
				title("Low numeracy", size (large))																			///
				name(topleft1, replace) scheme(plotplain)
graph close
drop p1 p2 p3
*------------------------------------------------------------------------------------------------------------------------------
* GRAPH2: TOP-RIGHT Graph (Non-incentivized & High numeracy)
* Graph below is the no-incentives high numeracy graph that will be in the top-right of the four graphs
* High Numeracy, Incentive=0
* For the three simulations below: num=4.35 out 6 questions correctly solved, numeracy=+1.654, incentive =0

* Congenial = -1
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy 1.654 congenial -1 num_con -1.654 numsq 2.736 incentive 0 in_con 0 in_num 0 in_num_con 0
simqi, prval(1) genpr(p1)
drop b*

* Congenial = +1
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy 1.654 congenial 1 num_con 1.654 numsq 2.736 incentive 0 in_con 0 in_num 0 in_num_con 0
simqi, prval(1) genpr(p2)
drop b*

* Congenial = 0
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy 1.654 congenial 0 num_con 0 numsq 2.736 incentive 0 in_con 0 in_num 0 in_num_con 0
simqi, prval(1) genpr(p3)
drop b*

sum p1 p2 p3

*-------------------------------------------------------GRAPH2-----------------------------------------------------------------
graph twoway 	(kdensity p1, lcolor(orange) lwidth(medthick) text(9 0.26 "Congenial = -1", color (orange) size(small))) 	///
				(kdensity p2, lcolor(green) lwidth(medthick) text(13.5 0.52 "Congenial = +1", color (green) size(small)))	/// 
				(kdensity p3, lcolor(gs5) lwidth(medthick) text(18 0.47 "Congenial = 0", color (gs5) size(small)))			///
				,legend(off)																								///
				ylabel("")																									///
				ytitle("") 																									///
				xlabel(0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%") 													///
				xtitle("") 																									///
				title("High numeracy", size (large))																		///
				name(topright1, replace) scheme(plotplain)
graph close
drop p1 p2 p3
*------------------------------------------------------------------------------------------------------------------------------
* GRAPH3: BOTTOM-LEFT Graph (Incentivized & Low numeracy)
* Graph below is the incentives low numeracy graph that will be in the bottom-left of the four graphs
* Low Numeracy, Incentive=1
* For the three simulations below: num=1 out 6 questions correctly solved, numeracy=-1.654, incentive =1

* Congenial = -1
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy -1.654 congenial -1 num_con 1.654 numsq 2.736 incentive 1 in_con -1 in_num -1.654 in_num_con 1.654
simqi, prval(1) genpr(p1)
drop b*

* Congenial = +1
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy -1.654 congenial 1 num_con -1.654 numsq 2.736 incentive 1 in_con 1 in_num -1.654 in_num_con -1.654
simqi, prval(1) genpr(p2)
drop b*

* Congenial = 0
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy -1.654 congenial 0 num_con 0 numsq 2.736 incentive 1 in_con 0 in_num -1.654 in_num_con 0
simqi, prval(1) genpr(p3)
drop b*

sum p1 p2 p3
*-------------------------------------------------------GRAPH3-----------------------------------------------------------------
graph twoway 	(kdensity p1, lcolor(orange) lwidth(medthick) text(9 0.49 "Congenial = -1", color (orange) size(small)))	///
				(kdensity p2, lcolor(green) lwidth(medthick) text(9 0.30 "Congenial = +1", color (green) size(small)))		/// 
				(kdensity p3, lcolor(gs5) lwidth(medthick) text(21 0.46 "Congenial = 0", color (gs5) size(small)))			///
				,legend(off)																								///
				ylabel("")																									///
				ytitle("  Incentivized  ", orientation(vertical) size(large))												///
				xlabel(0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%") 													///
				xtitle("probability of correct interpretation of data") 													///
				title("")																									///
				name(botleft1, replace) scheme(plotplain)
graph close
drop p1 p2 p3
*------------------------------------------------------------------------------------------------------------------------------
* GRAPH4: BOTTOM-RIGHT Graph (Incentivized & High numeracy)
* Graph below is the incentives high numeracy graph that will be in the bottom-right of the four graphs.*/
* High Numeracy, Incentive=1*/
* For the three simulations below: num=4.35 out 6 questions correctly solved, numeracy=1.654, incentive =1*/

* Congenial = -1
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy 1.654 congenial -1 num_con -1.654 numsq 2.736 incentive 1 in_con -1 in_num 1.654 in_num_con -1.654
simqi, prval(1) genpr(p1)
drop b*

* Congenial = +1
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy 1.654 congenial 1 num_con 1.654 numsq 2.736 incentive 1 in_con 1 in_num 1.654 in_num_con 1.654
simqi, prval(1) genpr(p2)
drop b*

* Congenial = 0
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy 1.654 congenial 0 num_con 0 numsq 2.736 incentive 1 in_con 0 in_num 1.654 in_num_con 0
simqi, prval(1) genpr(p3)
drop b*

sum p1 p2 p3
*-------------------------------------------------------GRAPH4-----------------------------------------------------------------
graph twoway 	(kdensity p1, lcolor(orange) lwidth(medthick) text(10 0.32 "Congenial = -1", color (orange) size(small)))	///
				(kdensity p2, lcolor(green) lwidth(medthick) text(19 0.54 "Congenial = +1", color (green) size(small)))		/// 
				(kdensity p3, lcolor(gs5) lwidth(medthick) text(23 0.51 "Congenial = 0", color (gs5) size(small)))			///
				,legend(off)																								///
				ylabel("")																									///
				ytitle("")																									///
				xlabel(0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%") 													///
				xtitle("probability of correct interpretation of data") 													///
				title("")																									///
				name(botright1, replace) scheme(plotplain)
graph close
drop p1 p2 p3
*------------------------------------------------------------------------------------------------------------------------------
*----------------------------------------------------- GRAPH COMBINE-----------------------------------------------------------
graph combine topleft1 topright1 botleft1 botright1, scheme(plotplain)
graph export "${main_appendix}/Figure_A5.png", replace
graph close
*------------------------------------------------------------------------------------------------------------------------------
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Table A27: Difference in the exhibited congeniality bias
*-------------------------------------------------------------------------------
*-------------------------------------------------------------------------------
* The program "Clarify" is necessary to run these simulations.
* Please see "Clarify: Software for Interpreting and Presenting Statistical Results" (Tomz, Wittenberg, and King; 2001) for your reference.
*-------------------------------------------------------------------------------
********************************************************************************
* Model SD 1
********************************************************************************
* Simulation 1
* No incentive and Low numeracy
* Incentive = 0 and Numeracy = -1.654
* Congenial = -1 for conservative and Congenial = +1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1) = Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy -1.654 congenial 1 num_con -1.654 numsq 2.736 incentive 0 in_con 0 in_num 0 in_num_con 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -1.654 1.654) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 2
* No incentive and High numeracy
* Incentive = 0 and Numeracy = 1.654
* Congenial = -1 for conservative and Congenial = +1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy 1.654 congenial 1 num_con 1.654 numsq 2.736 incentive 0 in_con 0 in_num 0 in_num_con 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 1.654 -1.654) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 3
* Incentive and Low numeracy
* Incentive = 1 and Numeracy= -1.654
* Congenial = +1 for conservative and Congenial = -1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy -1.654 congenial 1 num_con -1.654 numsq 2.736 incentive 1 in_con 1 in_num -1.654 in_num_con -1.654
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -1.654 1.654 in_con 1 -1 in_num_con -1.654 1.654) pr
drop b*
***********************************************************************************************************************
* Simulation 4
* Incentive and High numeracy
* Incentive = 1 and Numeracy = 1.654
* Congenial = +1 for conservative and Congenial = -1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy 1.654 congenial 1 num_con 1.654 numsq 2.736 incentive 1 in_con 1 in_num 1.654 in_num_con 1.654
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 1.654 -1.654 in_con 1 -1 in_num_con 1.654 -1.654) pr
drop b*
********************************************************************************
*Model SD 1.5
********************************************************************************
* Simulation 5
* No incentive and Low numeracy
* Incentive = 0 and Numeracy = -2.481
* Congenial = -1 for conservative and Congenial = +1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy -2.481 congenial 1 num_con -2.481 numsq 6.155 incentive 0 in_con 0 in_num 0 in_num_con 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -2.481 2.481) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 6
* No incentive and High numeracy
* Incentive = 0 and Numeracy = 2.481
* Congenial = -1 for conservative and Congenial = +1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy 2.481 congenial 1 num_con 2.481 numsq 6.155 incentive 0 in_con 0 in_num 0 in_num_con 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 2.481 -2.481) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 7
* Incentive and Low numeracy
* Incentive = 1 and Numeracy= -2.481
* Congenial = +1 for conservative and Congenial = -1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy -2.481 congenial 1 num_con -2.481 numsq 6.155 incentive 1 in_con 1 in_num -2.481 in_num_con -2.481
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -2.481 2.481 in_con 1 -1 in_num_con -2.481 2.481) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 8
* Incentive and High numeracy
* Incentive = 1 and Numeracy= 2.481
* Congenial = +1 for conservative and Congenial = -1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy 2.481 congenial 1 num_con 2.481 numsq 6.155 incentive 1 in_con 1 in_num 2.481 in_num_con 2.481
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 2.481 -2.481 in_con 1 -1 in_num_con 2.481 -2.481) pr
drop b*
********************************************************************************
*Model SD 2
********************************************************************************
* Simulation 9
* No incentive and Low numeracy
* Incentive = 0 and Numeracy= -3.308
* Congenial = -1 for conservative and Congenial = +1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy -3.308 congenial 1 num_con -3.308 numsq 10.943 incentive 0 in_con 0 in_num 0 in_num_con 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -3.308 3.308) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 10
* No incentive and High numeracy
* Incentive = 0 and Numeracy= 3.308
* Congenial = -1 for conservative and Congenial = +1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy 3.308 congenial 1 num_con 3.308 numsq 10.943 incentive 0 in_con 0 in_num 0 in_num_con 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 3.308 -3.308) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 11
* Incentive and Low numeracy
* Incentive = 1 and Numeracy= -3.308
* Congenial = +1 for conservative and Congenial = -1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy -3.308 congenial 1 num_con -3.308 numsq 10.943 incentive 1 in_con 1 in_num -3.308 in_num_con -3.308
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -3.308 3.308 in_con 1 -1 in_num_con -3.308 3.308) pr
drop b*
*-------------------------------------------------------------------------------
* Simulation 12
* Incentive and High numeracy
* Incentive = 1 and Numeracy = 3.308
* Congenial = +1 for conservative and Congenial = -1 for liberal
* We find the predicted differences in probability that partisans will correctly interpret the data
* Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)= Congeniality bias
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy 3.308 congenial 1 num_con 3.308 numsq 10.943 incentive 1 in_con 1 in_num 3.308 in_num_con 3.308
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 3.308 -3.308 in_con 1 -1 in_num_con 3.308 -3.308) pr
drop b*

*-------------------------------------------------------------------------------
****The results from the t-test below are used to create Table A27 manually in latex.
*-------------------------------------------------------------------------------

*Simulation1/2 SD1 No-incentive - Low vs High Numeracy
ttesti 1000  -.0414919 1.4049751  1000 -.14596 1.4545536

*Simulation3/4 SD1 Incentive - Low vs High Numeracy
ttesti 1000 .0148144 .98486355  1000 -.0973284  .98824405

*Simulation5/6 SD1.5 No-incentive - Low vs High Numeracy
ttesti 1000  -.0147676 1.82735  1000 -.1723222 1.8579045

*Simulation7/8 SD1.5 Incentive - Low vs High Numeracy
ttesti 1000 .0420155 1.2492040  1000 -.1261209  1.2602088

*Simulation9/10 SD2 No-incentive - Low vs High Numeracy
ttesti 1000 .0122335 2.2915888  1000 -.1985691 2.2935526

*Simulation11/12 SD2 Incentive - Low vs High Numeracy
ttesti 1000 .069221 1.5447948  1000 -.1539165 1.5519699
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Analysis with no deviations from pre-registration
* Logistic regression
* Table A28: The impact of numeracy and congeniality on accuracy (H1&H2)
* Table A29: The impact of numeracy and congeniality on accuracy (H3&H4)
*-------------------------------------------------------------------------------
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Table A28: The impact of numeracy and congeniality on accuracy (H1&H2)
*-------------------------------------------------------------------------------
* Equation 1 (without control variables) - Table A28 (1)
logit correct numeracy congenial num_con numsq if incentive==0, r
estadd local Controls "No"
est store a1

* Equation 1 (with control variables) - Table A28 (2)
logit correct numeracy congenial num_con numsq age i.gender i.race i.edu i.vote2016 if incentive==0, r
estadd local Controls "Yes"
est store a2

* Export Table A28 in Latex
esttab  a1 a2 using "${main_appendix}/Table_A28.tex" ,  ///
	    b(3) star(* 0.10 ** 0.05  *** 0.01) se(3) label  ///
		title(Testing Hypotheses 1 and 2) replace 	///
		drop(age *gender* *race* *edu* *vote2016*) /// 
		scalars("Controls") ///
		tex addnotes(Note:Logit regression with heterscedasticity robust standard errors.)
eststo clear	
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Table A29: The impact of numeracy and congeniality on accuracy (H3&H4)
*-------------------------------------------------------------------------------
* Equation 2 (without control variables) - Table A29 (3)
logit correct incentive, r
estadd local Controls "No"
est store a3

* Equation 2 (with control variables) - Table A29 (4)
logit correct incentive age i.gender i.race i.edu i.vote2016, r
estadd local Controls "Yes"
est store a4

* Equation 3 (without control variables) - Table A29 (5)
logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
estadd local Controls "No"
est store a5

* Equation 3 (with control variables) - Table A29 (6)
logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con age i.gender i.race i.edu i.vote2016, r
estadd local Controls "Yes"
est store a6

* Export Table A29 in Latex
esttab  a3 a4 a5 a6 using "${main_appendix}/Table_A29.tex" ,  ///
	    b(3) star(* 0.10 ** 0.05  *** 0.01) se(3) label  ///
		title(Testing Hypothesis 3 and 4) replace 	///
		drop(age *gender* *race* *edu* *vote2016*) /// 
		scalars("Controls") ///
		tex addnotes(Note:Logit regression with heterscedasticity robust standard errors.)
eststo clear
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Analysis with no deviations from pre-registration
* Additional visualizations of the interaction effects
* Figure A6: Response by subjects of opposing ideological outlooks
* Figure A7: Preficted difference in probability that partisans will correctly interpret the data
* Figure A8: Predicted probabilities of correctly interpreting the data (2SD)
*-------------------------------------------------------------------------------
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Figure A6: Response by subjects of opposing ideological outlooks
*-------------------------------------------------------------------------------
* No Incentives Treatment
graph twoway 	(lowess correct num if conservative<0 & treatment==1, bwidth(5) adjust lcolor(blue) lpattern(solid) text(0.44 6.35 "COVID dec" "Congenial", color (blue) size(small)))	///
				(lowess correct num if conservative<0 & treatment==2, bwidth(5) adjust lcolor(blue) lpattern(dash)text(0.34 6.35 "COVID inc" "Uncongenial", color (blue) size(small))) 	///
				(lowess correct num if conservative>0 & treatment==1, bwidth(5) adjust lcolor(red) lpattern(dash) text(0.51 6.35 "COVID dec" "Uncongenial", color (red) size(small)))	///
				(lowess correct num if conservative>0 & treatment==2, bwidth(5) adjust lcolor(red) lpattern(solid) text(0.58 6.35 "COVID inc" "Congenial", color (red) size(small))) 	///
				,legend(position(6) cols (2) order(1 "" 2 "    Liberal Democrats" 3 "" 4 "    Conservative Republicans"))	///
				ylabel(0.2(0.2)0.8, nogrid) ytitle("Correct interpretation of data (=1)")				///
				xlabel(0(1)6.6) xtitle("Numeracy score")	///
				title("Non-Incentivized Treatment") scheme(plotplain)
graph export "${main_appendix}/Figure_A6_1.png", replace
graph close

* Incentives Treatment
graph twoway 	(lowess correct num if conservative<0 & treatment==3, bwidth(5) adjust lcolor(blue) lpattern(solid) text(0.53 6.35 "COVID dec" "Congenial", color (blue) size(small)))	///
				(lowess correct num if conservative<0 & treatment==4, bwidth(5) adjust lcolor(blue) lpattern(dash)text(0.33 6.35 "COVID inc" "Uncongenial", color (blue) size(small))) 	///
				(lowess correct num if conservative>0 & treatment==3, bwidth(5) adjust lcolor(red) lpattern(dash) text(0.44 6.35 "COVID dec" "Uncongenial", color (red) size(small)))	///
				(lowess correct num if conservative>0 & treatment==4, bwidth(5) adjust lcolor(red) lpattern(solid) text(0.61 6.35 "COVID inc" "Congenial", color (red) size(small))) 	///
				,legend(position(6) cols (2) order(1 "" 2 "    Liberal Democrats" 3 "" 4 "    Conservative Republicans"))	///
				ylabel(0.2(0.2)0.8) ytitle("Correct interpretation of data (=1)")						///
				xlabel(0(1)6.6) xtitle("Numeracy score")	///
				title("Incentivized Treatment") scheme(plotplain)
graph export "${main_appendix}/Figure_A6_2.png", replace
graph close
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Figure A7: Predicted difference in probability that partisans will correctly interpret the data
*-------------------------------------------------------------------------------
***********************************************************************************************************************
*We generate the confidence intervals for Figure A7 using the following simulations that use the package Clarify. We use the data generated 
*in these simulations to create the figure.
***********************************************************************************************************************

/*Confidence Interval 1*/
/*CI below is for the no-incentives covid decreases (Treatment 1): low numeracy.*/
/*For the simulation below: num=1 out 6 questions correctly solved, numeracy=-1.654, incentive =0*/
/*Congenial = -1 for conservative and Congenial = +1 for liberal*/
/*We find the predicted differences in probability that partisans will correctly interpret the data.*/
/*Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1)*/
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con, r
setx numeracy -1.654 congenial 1 num_con -1.654 numsq 2.736 numsq_con 2.736 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -1.654 1.654 numsq_con 2.736 -2.736) pr
drop b*

***********************************************************************************************************************
***********************************************************************************************************************

/*Confidence Interval 2*/
/*CI below is for the no-incentives covid decreases (Treatment 1): high numeracy.*/
/*For the simulation below: num=4.35 out 6 questions correctly solved, numeracy=+1.654, incentive =0*/
/*Congenial = -1 for conservative and Congenial = +1 for liberal*/
/*We find the predicted differences in probability that partisans will correctly interpret the data.*/
/*Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1)*/
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con, r
setx numeracy 1.654 congenial 1 num_con 1.654 numsq 2.736 numsq_con 2.736 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 1.654 -1.654 numsq_con 2.736 -2.736) pr
drop b*

***********************************************************************************************************************
***********************************************************************************************************************

/*Confidence Interval 3*/
/*CI below is for the no-incentives covid increases (Treatment 2): low numeracy.*/
/*For the simulation below: num=1 out 6 questions correctly solved, numeracy=-1.654, incentive =0*/
/*Congenial = +1 for conservative and Congenial = -1 for liberal*/
/*We find the predicted differences in probability that partisans will correctly interpret the data.*/
/*Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)*/
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con, r
setx numeracy -1.654 congenial -1 num_con 1.654 numsq 2.736 numsq_con -2.736 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0
simqi, fd(prval(1)) changex(congenial -1  1 num_con 1.654 -1.654 numsq_con -2.736 2.736) pr
drop b*

***********************************************************************************************************************
***********************************************************************************************************************

/*Confidence Interval 4*/
/*CI below is for the no-incentives covid increases (Treatment 2): high numeracy.*/
/*For the simulation below: num=4.35 out 6 questions correctly solved, numeracy=1.654, incentive =0*/
/*Congenial = +1 for conservative and Congenial = -1 for liberal*/
/*We find the predicted differences in probability that partisans will correctly interpret the data.*/
/*Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)*/
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con, r
setx numeracy 1.654 congenial -1 num_con -1.654 numsq 2.736 numsq_con -2.736 incentive 0 in_con 0 in_num 0 in_numsq 0 in_num_con 0 in_numsq_con 0
simqi, fd(prval(1)) changex(congenial -1  1 num_con -1.654 1.654 numsq_con -2.736 2.736) pr
drop b*

***********************************************************************************************************************
***********************************************************************************************************************


***********************************************************************************************************************
***********************************************************************************************************************

/*Confidence Interval 5*/
/*CI below is for the incentives covid decreases (Treatment 3): low numeracy.*/
/*For the simulation below: num=1 out 6 questions correctly solved, numeracy=-1.654, incentive =1*/
/*Congenial = -1 for conservative and Congenial = +1 for liberal*/
/*We find the predicted differences in probability that partisans will correctly interpret the data.*/
/*Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1)*/
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con, r
setx numeracy -1.654 congenial 1 num_con -1.654 numsq 2.736 numsq_con 2.736 incentive 1 in_con 1 in_num -1.654 in_numsq 2.736 in_num_con -1.654 in_numsq_con 2.736
simqi, fd(prval(1)) changex(congenial 1  -1 num_con -1.654 1.654 numsq_con 2.736 -2.736 in_con 1 -1 in_num_con -1.654 1.654 in_numsq_con 2.736 -2.736) pr
drop b*

***********************************************************************************************************************
***********************************************************************************************************************

/*Confidence Interval 6*/
/*CI below is for the incentives covid decreases (Treatment 3): high numeracy.*/
/*For the simulation below: num=4.35 out 6 questions correctly solved, numeracy=+1.654, incentive =1*/
/*Congenial = -1 for conservative and Congenial = +1 for liberal*/
/*We find the predicted differences in probability that partisans will correctly interpret the data.*/
/*Prob difference = Pr(correct=1|congenial=-1) - Pr(correct=1|congenial=+1)*/
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con, r
setx numeracy 1.654 congenial 1 num_con 1.654 numsq 2.736 numsq_con 2.736 incentive 1 in_con 1 in_num 1.654 in_numsq 2.736 in_num_con 1.654 in_numsq_con 2.736
simqi, fd(prval(1)) changex(congenial 1  -1 num_con 1.654 -1.654 numsq_con 2.736 -2.736 in_con 1 -1 in_num_con 1.654 -1.654 in_numsq_con 2.736 -2.736) pr
drop b*

***********************************************************************************************************************
***********************************************************************************************************************

/*Confidence Interval 7*/
/*CI below is for the incentives covid increases (Treatment 4): low numeracy.*/
/*For the simulation below: num=1 out 6 questions correctly solved, numeracy=-1.654, incentive =1*/
/*Congenial = +1 for conservative and Congenial = -1 for liberal*/
/*We find the predicted differences in probability that partisans will correctly interpret the data.*/
/*Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)*/
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con, r
setx numeracy -1.654 congenial -1 num_con 1.654 numsq 2.736 numsq_con -2.736 incentive 1 in_con -1 in_num -1.654 in_numsq 2.736 in_num_con 1.654 in_numsq_con -2.736
simqi, fd(prval(1)) changex(congenial -1  1 num_con 1.654 -1.654 numsq_con -2.736 2.736 in_con -1 1 in_num_con 1.654 -1.654 in_numsq_con -2.736 2.736) pr
drop b*

***********************************************************************************************************************
***********************************************************************************************************************

/*Confidence Interval 8*/
/*CI below is for the incentives covid increases (Treatment 4): high numeracy.*/
/*For the simulation below: num=4.35 out 6 questions correctly solved, numeracy=1.654, incentive =1*/
/*Congenial = +1 for conservative and Congenial = -1 for liberal*/
/*We find the predicted differences in probability that partisans will correctly interpret the data.*/
/*Prob difference = Pr(correct=1|congenial=1) - Pr(correct=1|congenial=-1)*/
set seed 2121985
estsimp logit correct numeracy congenial num_con numsq numsq_con incentive in_con in_num in_numsq in_num_con in_numsq_con, r
setx numeracy 1.654 congenial -1 num_con -1.654 numsq 2.736 numsq_con -2.736 incentive 1 in_con -1 in_num 1.654 in_numsq 2.736 in_num_con -1.654 in_numsq_con -2.736
simqi, fd(prval(1)) changex(congenial -1  1 num_con -1.654 1.654 numsq_con -2.736 2.736 in_con -1 1 in_num_con -1.654 1.654 in_numsq_con -2.736 2.736) pr
drop b*

***********************************************************************************************************************
***********************************************************************************************************************

use "${main_data}/Probdiff_data.dta", clear /*data in this file is generated using the simulations named Confidence interval 1-8 above*/
set scheme plotplain
graph twoway 	(rcap ci_high ci_low row if prob_mean <= -0.05, horizontal lcolor(blue) lwidth(medium) yaxis(1)) ///
				(rcap ci_high ci_low row if prob_mean >= 0.05, horizontal lcolor(red) lwidth(medium) yaxis(1)) ///
				(rcap ci_high ci_low row if prob_mean >= -0.05 & prob_mean <= 0.05, horizontal lcolor(black) lwidth(medium) yaxis(1)) ///
				(rcap ci_high ci_low row if prob_mean <= -0.05, horizontal lcolor(blue) lwidth(medium) yaxis(2)) ///
				(rcap ci_high ci_low row if prob_mean >= 0.05, horizontal lcolor(red) lwidth(medium) yaxis(2)) ///
				(rcap ci_high ci_low row if prob_mean >= -0.05 & prob_mean <= 0.05, horizontal lcolor(black) lwidth(medium) yaxis(2)) ///
				(scatter row prob_mean if prob_mean <= -0.05, mcolor(blue) msize(medlarge) msymbol(D)) ///
				(scatter row prob_mean if prob_mean >= 0.05, mcolor(red)msize(medlarge) msymbol(D)) ///
				(scatter row prob_mean if prob_mean >= -0.05 & prob_mean <= 0.05, mcolor(black) msize(medlarge) msymbol(D)) ///
				,yscale(reverse) ///
				yscale(axis(2) reverse) ///
				ylabel(1 "No Incentive " 2 "COV decreases" 5 "No Incentive " 6 "COV increases" 9 "Incentive    " 10 "COV decreases" 13 "Incentive    " 14 "COV increases", angle(0) notick nogrid) ///
				ylabel(1 "Low numeracy" 2 "High numeracy" 5 "Low numeracy" 6 "High numeracy" 9 "Low numeracy" 10 "High numeracy" 13 "Low numeracy" 14 "High numeracy", angle(0) axis(2) noticks) ///
				ytitle("") ///
				ytitle("", axis(2)) ///
				xlabel(-0.25 "25%" -0.20 "20%" -0.15 "15%" -0.10 "10%" -0.05 "5%" 0 "0%" 0.05 "5%" 0.10 "10%" 0.15 "15%" 0.20 "20%" 0.25 "25%", grid) ///
				xtitle("Pct. difference in probability of correct interpretation of data") ///
				xline(0, lcolor(gs8) lpattern(dash)) ///
				legend(order(4 "Liberal Democrats more likely" 6 "No difference between Lib-Dem vs Con-Rep" 5 "Conservative Republicans more likely") rows(3) position(6))
graph export "${main_appendix}/Figure_A7.png", replace
graph close
*-------------------------------------------------------------------------------
* Reload data
use "${main_data}/pol_v0.8.dta", clear
*-------------------------------------------------------------------------------
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Figure A8: Predicted probabilities of correctly interpreting the data (2SD)
*-------------------------------------------------------------------------------
* The program "Clarify" is necessary to run these simulations.
* Please see "Clarify: Software for Interpreting and Presenting Statistical Results" (Tomz, Wittenberg, and King; 2001) for your reference.
*-------------------------------------------------------------------------------
* GRAPH5: TOP-LEFT Graph
* Graph below is the no-incentives low numeracy graph that will be in the top-left of the four graphs
* Low Numeracy, Incentive=0
* For the three simulations below: num=1 out 6 questions correctly solved, numeracy=-1.654, incentive =0

* Congenial = -2
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy -1.654 congenial -2 num_con 3.308 numsq 2.736 incentive 0 in_con 0 in_num 0 in_num_con 0
simqi, prval(1) genpr(p4)
drop b*

* Congenial = +2
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy -1.654 congenial 2 num_con -3.308 numsq 2.736 incentive 0 in_con 0 in_num 0 in_num_con 0
simqi, prval(1) genpr(p5)
drop b*

*-------------------------------------------------------GRAPH5-----------------------------------------------------------------
graph twoway 	(kdensity p4, lcolor(dknavy) lwidth(medthick) text(6 0.26 "Congenial = -2", color (dknavy) size(small)))		///
				(kdensity p5, lcolor(dkorange) lwidth(medthick) text(7 0.58 "Congenial = +2", color (dkorange) size(small)))	/// 
				,legend(off)																									///
				ylabel("")																										///
				ytitle("Non-Incentivized", orientation(vertical) size(large)) 													///
				xlabel(0.1 "10%" 0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%" 0.7 "70%")									///
				xtitle("") 																										///
				title("Low numeracy", size (large))																				///
				name(topleft2, replace) scheme(plotplain)
graph close
drop p4 p5 
*------------------------------------------------------------------------------------------------------------------------------
* GRAPH6: TOP-RIGHT Graph
* Graph below is the no-incentives high numeracy graph that will be in the top-right of the four graphs
* High Numeracy, Incentive=0
* For the three simulations below: num=1 out 6 questions correctly solved, numeracy=+1.654, incentive =0

* Congenial = -2
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy 1.654 congenial -2 num_con -3.308 numsq 2.736 incentive 0 in_con 0 in_num 0 in_num_con 0
simqi, prval(1) genpr(p4)
drop b*

* Congenial = +2
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy 1.654 congenial 2 num_con 3.308 numsq 2.736 incentive 0 in_con 0 in_num 0 in_num_con 0
simqi, prval(1) genpr(p5)
drop b*

*-------------------------------------------------------GRAPH6-----------------------------------------------------------------
graph twoway 	(kdensity p4, lcolor(dknavy) lwidth(medthick) text(8 0.38 "Congenial = -2", color (dknavy) size(small)))		///
				(kdensity p5, lcolor(dkorange) lwidth(medthick) text(6 0.44 "Congenial = +2", color (dkorange) size(small)))	/// 
				,legend(off)																									///
				ylabel("")																										///
				ytitle("") 																										///
				xlabel(0.1 "10%" 0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%" 0.7 "70%")									///
				xtitle("") 																										///
				title("High numeracy", size (large))																			///
				name(topright2, replace) scheme(plotplain)
graph close
drop p4 p5 
*------------------------------------------------------------------------------------------------------------------------------
* GRAPH7: BOTTOM-LEFT Graph
* Graph below is the incentives low numeracy graph that will be in the bottom-left of the four graphs
* Low Numeracy, Incentive=1
* For the three simulations below: num=1 out 6 questions correctly solved, numeracy=-1.654, incentive =0

* Congenial = -2
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy -1.654 congenial -2 num_con 3.308 numsq 2.736 incentive 1 in_con -2 in_num -1.654 in_num_con 3.308
simqi, prval(1) genpr(p4)
drop b*

* Congenial = +2
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy -1.654 congenial 2 num_con -3.308 numsq 2.736 incentive 1 in_con 2 in_num -1.654 in_num_con -3.308
simqi, prval(1) genpr(p5)
drop b*

*-------------------------------------------------------GRAPH7-----------------------------------------------------------------
graph twoway 	(kdensity p4, lcolor(dknavy) lwidth(medthick) text(7 0.53 "Congenial = -2", color (dknavy) size(small)))		///
				(kdensity p5, lcolor(dkorange) lwidth(medthick) text(7 0.25 "Congenial = +2", color (dkorange) size(small)))	/// 
				,legend(off)																									///
				ylabel("")																										///
				ytitle("Incentivized", orientation(vertical) size(large)) 														///
				xlabel(0.1 "10%" 0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%" 0.7 "70%")									///
				xtitle("") 																										///
				title("")																										///
				name(botleft2, replace) scheme(plotplain)
graph close
drop p4 p5 
*------------------------------------------------------------------------------------------------------------------------------
* GRAPH8: BOTTOM-RIGHT Graph
* Graph below is the incentives high numeracy graph that will be in the bottom-right of the four graphs
* High Numeracy, Incentive=1
* For the three simulations below: num=1 out 6 questions correctly solved, numeracy=+1.654, incentive =0

* Congenial = -2
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy 1.654 congenial -2 num_con -3.308 numsq 2.736 incentive 1 in_con -2 in_num 1.654 in_num_con -3.308
simqi, prval(1) genpr(p4)
drop b*

* Congenial = +2
estsimp logit correct numeracy congenial num_con numsq incentive in_con in_num in_num_con, r
setx numeracy 1.654 congenial 2 num_con 3.308 numsq 2.736 incentive 1 in_con 2 in_num 1.654 in_num_con 3.308
simqi, prval(1) genpr(p5)
drop b*

*-------------------------------------------------------GRAPH8-----------------------------------------------------------------
graph twoway 	(kdensity p4, lcolor(dknavy) lwidth(medthick) text(7 0.24 "Congenial = -2", color (dknavy) size(small)))		///
				(kdensity p5, lcolor(dkorange) lwidth(medthick) text(12 0.55 "Congenial = +2", color (dkorange) size(small)))	/// 
				,legend(off)																									///
				ylabel("")																										///
				ytitle("") 																										///
				xlabel(0.1 "10%" 0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%" 0.6 "60%" 0.7 "70%")									///
				xtitle("") 																										///
				title("")																										///
				name(botright2, replace) scheme(plotplain)
graph close
drop p4 p5 
*------------------------------------------------------------------------------------------------------------------------------
*----------------------------------------------------- GRAPH COMBINE-----------------------------------------------------------
graph combine topleft2 topright2 botleft2 botright2, xcommon scheme(plotplain)
graph export "${main_appendix}/Figure_A8.png", replace
graph close
*------------------------------------------------------------------------------------------------------------------------------
***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
*-------------------------------------------------------------------------------
* Analysis with no deviations from pre-registration
* Difference in accuracy between supporters and opponents of mask mandates
* Table A30: Difference in accuracy (high numeracy)
* Table A31: Difference in accuracy (low numeracy)
/*Table A30: Differences in accuracy between presumed supporters 
and opponents of mask mandates (high numeracy respondents)*/	

su conservative, detail

*drop cons_dum
gen cons_dum = 0
replace cons_dum=1 if conservative>=1
tab cons_dum

*drop lib_dum
gen lib_dum = 0
replace lib_dum=1 if conservative<=-1
tab lib_dum

*** Conservative Republicans ***
mat T = J(2,5,.)
	 
ttest correct if incentive==0 & num>=5 & cons_dum==1, by(covid_inc)
mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)

ttest correct if incentive==1 & num>=5 & cons_dum==1, by(covid_inc)
mat T[2,1] = r(mu_1)
mat T[2,2] = r(mu_2)
mat T[2,3] = r(mu_1) - r(mu_2)
mat T[2,4] = r(t)
mat T[2,5] = r(p)

mat rownames T =  "Conservative, high num, no inc"  "Conservative, high num, inc"

	frmttable using cp_ttest_table3a.doc, statmat(T) varlabels replace ///
	ctitle("",  Congeniality less than 75th pct=0, Congeniality more than 75th pct=1, Difference, t-statistic, p-value)
	
*** ***DiD for High Numeracy Conservative Republicans: Unincentivzied vs. Incentivized *** ***

*SD1=.1764646*(sqrt(30))=0.96653642021
*SD2=0.1309743*(sqrt(57))=0.98883428027
ttesti 30 -.3888889  0.96653642021     57 -.1481481    0.98883428027

*** Liberal Democrats ***
mat T = J(2,5,.)
	 
ttest correct if incentive==0 & num>=5 & lib_dum==1, by(covid_dec)
mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)

ttest correct if incentive==1 & num>=5 & lib_dum==1, by(covid_dec)
mat T[2,1] = r(mu_1)
mat T[2,2] = r(mu_2)
mat T[2,3] = r(mu_1) - r(mu_2)
mat T[2,4] = r(t)
mat T[2,5] = r(p)

mat rownames T =  "Liberal, high num, no inc"  "Liberal, high num, inc"

	frmttable using cp_ttest_table3a.doc, statmat(T) varlabels replace ///
	ctitle("",  Congeniality less than 75th pct=0, Congeniality more than 75th pct=1, Difference, t-statistic, p-value)

*** ***DiD for High Numeracy Liberal Democrats: Unincentivzied vs. Incentivized *** ***

*SD1=.1525856*(sqrt(37))=0.92814197034
*SD2=.1075461*(sqrt(83))=0.97979160074
ttesti 37 	-.1461988 0.92814197034 83 	-.2911164	0.97979160074

/*Table A31: Differences in accuracy between presumed supporters and 
opponents of mask mandates (low numeracy respondents)*/	


*** Conservative Republicans ***
mat T = J(2,5,.)
	 
ttest correct if incentive==0 & num<=1 & cons_dum==1, by(covid_inc)
mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)

ttest correct if incentive==1 & num<=1 & cons_dum==1, by(covid_inc)
mat T[2,1] = r(mu_1)
mat T[2,2] = r(mu_2)
mat T[2,3] = r(mu_1) - r(mu_2)
mat T[2,4] = r(t)
mat T[2,5] = r(p)

mat rownames T =  "Conservative, low num, no inc"  "Conservative, low num, inc"

	frmttable using cp_ttest_table3a.doc, statmat(T) varlabels replace ///
	ctitle("",  Congeniality less than 75th pct=0, Congeniality more than 75th pct=1, Difference, t-statistic, p-value)

*** ***DiD for Low Numeracy Conservative Republicans: Unincentivzied vs. Incentivized *** ***

*SD1=.1548035*(sqrt(35))=0.9158298567
*SD2=.1049378*(sqrt(87))=0.97879463759
ttesti 35  -.0714286    0.9158298567 87 .2264051 0.97879463759


*** Liberal Democrats ***
mat T = J(2,5,.)
	 
ttest correct if incentive==0 & num<=1 & lib_dum==1, by(covid_dec)
mat T[1,1] = r(mu_1)
mat T[1,2] = r(mu_2)
mat T[1,3] = r(mu_1) - r(mu_2)
mat T[1,4] = r(t)
mat T[1,5] = r(p)

ttest correct if incentive==1 & num<=1 & lib_dum==1, by(covid_dec)
mat T[2,1] = r(mu_1)
mat T[2,2] = r(mu_2)
mat T[2,3] = r(mu_1) - r(mu_2)
mat T[2,4] = r(t)
mat T[2,5] = r(p)

mat rownames T =  "Liberal, low num, no inc"  "Liberal, low num, inc"

	frmttable using cp_ttest_table3a.doc, statmat(T) varlabels replace ///
	ctitle("",  Congeniality less than 75th pct=0, Congeniality more than 75th pct=1, Difference, t-statistic, p-value)
	
		
*** ***DiD for Low Numeracy Liberal Democrats: Unincentivzied vs. Incentivized *** ***

*SD1=.1403197*(sqrt(50))=0.99221011404
*SD2=.1004664*(sqrt(98))=0.9945666181
ttesti 	50 	-.2051282  0.99221011404  98  -.145    .9945666181 




/**** Drop unnecessary dummies: ****/

drop cons_dum lib_dum

***********************************************************************************************************************************************
***********************************************************************************************************************************************
***********************************************************************************************************************************************
log close
exit
